PyQt5 and virtualenv problem

Pete Forman petef4+usenet at gmail.com
Fri Aug 2 06:11:22 EDT 2013


"D. Xenakis" <gouzounakis at hotmail.com> writes:

> I tried to install SIP and PyQt5 using the pip install command but it
> didnt work on both cases (i was getting errors), so i finally
> installed them using the windows installers provided in
> riverbankcomputing website.
> My problem though here is that whenever i try to create a new
> virtualenv enviroment, those packages are not included and i cant
> import them. How can i add PyQt5 to my new virt enviroment? What is
> the logic behind this problem so i understand whats going on here?
>
> Thx in advance

I can't comment on PyQt5 but I can say how to use PyQt4 with virtualenv
on Windows.

The Riverbank installers do not work in a virtualenv. However PySide
wraps PyQt4 in a compatible installer. To use the installer it should be
invoked with easy_install rather than pip install. Having installed it,
pip uninstall works.

https://pypi.python.org/pypi/PySide


The Riverbank installer can install PyQt5 to your master copy of Python.
You can then use the --system-site-packages flag when creating a
virtualenv. The default behavior of virtualenv changed in 1.7
(2011-11-30) from including system packages to excluding them.

-- 
Pete Forman



More information about the Python-list mailing list