[PyQt] Installing Pyqt4 in a virtual environment

Florian Bruhin me at the-compiler.org
Thu Jul 2 05:10:56 BST 2015

* Giselle Sosa Jones <giselle1701 at gmail.com> [2015-07-01 21:47:54 -0430]:
> I'm working on Ubuntu 12.04 which comes with Python 2.7, so I installed
> Python 3.2 and created a virtual environment. Then I used pip  to install
> Numpy, SciPy and lxml, but I also need Pyqt4 and I can't install it using
> pip so I have no idea how to do it. I'm a new Linux user so I'm not very
> sharp with these things. Can someone help me please? Thank you very much!!!!

There are basically three options:

- Download the sip and PyQt4 source and compile them by hand in the
  virtualenv - see [1].

- Create the virtualenv with --system-site-packages and install PyQt4
  system-wide. This however means all your other system-wide packages
  are available in the virtualenv as well, which might not be what you

- Install PyQt4 system-wide and symlink it into the virtualenv - I
  wrote a script[2] to do that. Call it with your system Python (not
  the virtualenv one!) and pass the path to the virtualenv.


[1] http://pyqt.sourceforge.net/Docs/PyQt4/installation.html
[2] https://github.com/The-Compiler/qutebrowser/blob/master/scripts/link_pyqt.py

http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150702/400b6fbb/attachment.sig>

More information about the PyQt mailing list