Setting up PySide

This is your first step in this series of learning. PySide is compatible with Python 2.6, Qt 4.6 or their later versions. So, before getting to install PySide, we must make sure that the minimum version compatibility is achieved. This section will teach you two ways of installing PySide. One, being the most common and easy way, is using simple point-and-click installers and package managers. This will install a most stable version of PySide in your system which you can use comfortably without worrying too much about the stability. However, if you are an advanced programmer, you may prefer to build PySide from scratch, from the latest builds available when you are reading this book. Both these methods are explained here for Windows, Mac OS X, and Linux systems, and you are free to choose your own setup style.

Installation

This section explains the ways to install PySide on Windows, Linux, and Macintosh operating systems.

Windows

Installation of PySide on Windows is easy with the help of installer. Follow these steps for setting up PySide on Windows:

  1. Get the latest stable package compatible to your operating system architecture and the Python version installed from the releases page:

    http://qt-project.org/wiki/PySide_Binaries_Windows

  2. Run the downloaded installer executable which will automatically detect the Python installation from your system.
  3. You are given an option to install PySide on the default path or at the path of your choice.
  4. Click on Next in the subsequent windows, and finally on Finish, PySide is installed successfully on your system.

Mac OS X

The binaries for MAC OS X installers of PySide are available at:

http://qt-project.org/wiki/PySide_Binaries_MacOSX

Download the latest version compatible with your system and carry out installation as explained earlier.

You can also choose to install the PySide from the command line with the help of Homebrew or by using MacPorts. The commands are:

brew install pyside
port-install pyXX-pyside

replacing XX with your Python version

Linux

Installing PySide on a Debian-based system is much easier with the synaptic package manager. Issuing the following command will fetch and install the latest stable version available in the aptitude distro:

sudo apt-get install python-pyside

On an RPM based system, you can use the RPM-based distro yum:

yum install python-pyside pyside-tools

Tip

If you want to make sure that PySide is installed properly in your system, issue the following commands in the Python shell environment as shown in the following figure:

import PySide: This should not return any errors

PySide.__version__: This should output something like 1.1.2

A sample output is given for your reference is shown as follows:

Linux
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.114.19