2

I have a problem with a multiple python install on a win7 system. I Have a Python2.6.4 and a Python3.1. each of them have a different PyQt4 version properly installed in their site-packages directories. to be more specific:

Python2.6.4 with PyQt4 4.7.3
Python3.1 with PyQt4 4.8.2

The problem is that I cant seem to import PyQt4 within any of these versions. This is clearly a problem of path conflict.

I removed any path from the path environment variable and tried to set them specifically for each python versions via :

  • [.pth] files in each version site-packages folders
  • adding manually the PyQt4 folder in the sys.path within my scripts before importing it but none worked

The only way I found that makes it work is to add PyQt4 folders in the system env path which is not convenient as I have to change it manually each time I switch of Python version.

What am I doing wrong ?

Pic
  • 105
  • 2
  • 10
  • Why aren't you using [virtualenv](http://www.virtualenv.org/en/latest/)? – gatto Apr 25 '13 at 11:46
  • I dont know how the package work, never used it before. Was trying to find a solution without having to install something new and spend time to get it to work. But is there is no other solution I'll try it. Though Iguess there must be something simpler – Pic Apr 25 '13 at 11:53
  • Are these using the same or different Qt installation? Where is it, eg. QtCore4.dll? – Janne Karila Apr 25 '13 at 11:55
  • Each Python version has its own PyQt4 versions installed in their respective site-packages subfolders – Pic Apr 25 '13 at 11:59
  • Yes, but PyQt needs Qt. – Janne Karila Apr 25 '13 at 12:02
  • If I'm not mistaken all QT libraries are installed under the bin folder within the PyQt install aren't they ? ( QtCore4.dll , QtGui4.dll, QtOpenGL4.dll among all others are there ). So to answer your question each PyQt4 uses its own QT version or at least should do so – Pic Apr 25 '13 at 12:07
  • Your answer guided me on the road to a solution Janne, thanks for it. The problem was not with PyQt but with Qt itself. It needs to be in the system path or its libraries wont be available when called by PyQt modules. In other words the modules were found, only Qt libraries were not. – Pic Apr 25 '13 at 12:39

0 Answers0