Building PySide on a Windows System

Installing prerequisites

  1. Install Python.

  2. Install Qt 4.8 libraries for Windows VS 2008 edition when building against Python 2.6, 2.7 or 3.2.

    Install Qt 4.8 libraries for Windows VS 2010 edition when building against Python 3.3 or 3.4.

  3. Install Cmake.

  4. Install Windows SDK v7.0 when building against Python 2.6, 2.7 or 3.2.

    Install Windows SDK v7.1 when building against Python 3.3 or 3.4.

  5. Install Git.

  6. (Optional) Install OpenSSL.

  7. Install latest pip distribution into the Python you installed in the first step: download get-pip.py and run it using the python interpreter of your Python 2.7 installation using a command prompt:

    c:\> c:\Python27\python get-pip.py
    
  8. Install latest wheel distribution:

    c:\> c:\Python27\Scripts\pip install wheel
    

Note

  • If you are using the Windows SDK versions linked above, make sure that you have .NET Framework Version 4.0 installed on your system. Version 4.5 will not work.
  • To avoid problems with environment variables, execute all commands below in a “Windows SDK Comamnd Prompt” that you will find in your Start Menu, instead of a standard cmd.exe command line.

Building PySide distribution

  1. Download and extract PySide source distribution

  2. Switch to the distribution directory:

    c:\> cd PySide-1.2.4
    
  3. Build the wheel binary distribution:

    c:\> c:\Python27\python.exe setup.py bdist_wheel --qmake=c:\Qt\4.8.7\bin\qmake.exe --openssl=c:\OpenSSL32bit\bin
    

Building PySide distribution from a Git repository

  1. Clone PySide setup scripts from git repository:

    c:\> git clone https://github.com/PySide/pyside-setup.git pyside-setup
    
  2. Switch to the pyside-setup directory:

    c:\> cd pyside-setup
    
  3. Build the wheel binary distribution:

    c:\> c:\Python27\python.exe setup.py bdist_wheel --version=1.2.4 --qmake=c:\Qt\4.8.7\bin\qmake.exe --openssl=c:\OpenSSL32bit\bin
    
  4. To build the development version of PySide distribution, ignore the –version parameter:

    c:\> c:\Python27\python.exe setup.py bdist_wheel --qmake=c:\Qt\4.8.7\bin\qmake.exe --openssl=c:\OpenSSL32bit\bin
    

Installing PySide distribution

  1. After the successful build, install the distribution with pip:

    c:\> c:\Python27\Scripts\pip install dist\PySide-1.2.4-cp27-none-win32.whl
    

Installing PySide distribution into virtual Python environment

  1. Install latest virtualenv distribution:

    c:\> c:\Python27\Scripts\pip install virtualenv
    
  2. Use virtualenv to make a workspace:

    c:\> c:\Python27\Scripts\virtualenv env
    
  3. Switch to the env directory:

    c:\> cd env
    
  4. Install the distribution with pip:

    c:\> Scripts\pip install ..\dist\PySide-1.2.4-cp27-none-win32.whl