Introduction

To get started with developing GUI applications with PySide2, you can follow the comprehensive guides at the Qt official site. There are also platform specific guides: Windows, macOS, and Linux. (PySide2: Installation)

Getting Started on macOS

Versions:
  • Python 3.7.7
  • PySide2 5.14.1

Firstly, it’s always good to start your python coding in a virtual environment.

virtualenv testenv
source testenv/bin/activate

Then, install sphinx, numpy, PyOpenGL, and most importantly PySide2 to run the PySide2 examples.

pip install sphinx
pip install numpy PyOpenGL
pip install pyside2

To acquire the examples, you can clone the repository at GitHub, and run the standard tetrix.py example.

git clone https://github.com/pyside/pyside2-setup.git
python pyside2-setup/examples/widgets/widgets/tetrix.py

Getting Started on Windows

On Windows platform, I mainly rely on Anaconda to manage the dependencies throughout my Python developments. Here, I will use Anaconda Navigator to launch the console shortcut.

Versions:
  • Python 3.7.7
  • PySide2 5.14.1

Firstly, it’s a good practice to start your python coding in a virtual environment.

virtualenv testenv
call testenv\Scripts\activate

Then, install sphinx, numpy, PyOpenGL, and most importantly PySide2 to run the PySide2 examples.

pip install sphinx
pip install numpy PyOpenGL
pip install pyside2

To acquire the examples, you can clone the repository at GitHub, and run the standard tetrix.py example.

git clone https://github.com/pyside/pyside2-setup.git
python pyside2-setup\examples\widgets\widgets\tetrix.py

Output

Visual output from the tetrix.py

The visual outputs on different platform may vary. If you are stuck at any steps, do leave me a comment and I will help you go through the installation.

Leave a comment

Your email address will not be published. Required fields are marked *