Using Py 1.5.2 libs/mods with Py 2.2 ? (for PyQt)

Phil Thompson phil at river-bank.demon.co.uk
Sat Jan 11 06:55:25 EST 2003


On Friday 10 January 2003 11:18 am, Az Tech wrote:
> Hello list,
>
> 1. I have Red Hat Linux 7.3.
>
> 2. Python 1.5.2 came preinstalled with it.
>
> 3. Then, either:
>     - I installed PyQt 3.1
>     OR
>     - it was already installed along with RHL 7.2
>     (I don't remember which of the above, now, as it
> was some time back).
>
> 4. Then some days later I installed Python 2.2 from
> the RH apps CD.
>
> When I tried to run one of the example PyQt apps
> (using Py 2.2), I got an error on the 'import qt'
> statement - to the effect that the qt module was not
> found.
>
> 5. Since I knew that PyQt was installed (by doing an
> "rpm -q PyQt" and "rpm -q PyQt-examples", both of
> which showed that the respective packages were
> installed), I was surprised at the above error.
> (I had not realized at this point, that I had
> installed Py 2.2 after installing PyQt 3.1)
>
> 6. Doing a 'find / -name "*[Pp][Yy][Qq][Tt]*' showed
> the location of the PyQt files - they were installed
> in the Python 1.5.2 site-packages directory, not in
> that of Py 2.2.
>
> 7. So I switched to Py 1.5.2 and tried running the
> examples. Some of them worked, some partly worked and
> partly gave some errors. I am not sure if this is due
> to a version clash between Py 1.5.2 and the PyQt
> version which is 3.1 (and my Qt version is 3.0.3).
>
> 8. I can of course uninstall PyQt, and then re-install
> it in the Py 2.2 tree; I haven't tried this yet but I
> think I should be able to manage it. And I know that
> this is probably the right way to do it.
>
> 9. However, I may not want to do that just now.
> Generalizing the situation, this led me to wonder
> whether is is possible and "officially" recommended to
> use one version of Python with the libraries / modules
> installed in the site-packages directory of another
> version, and if so, what is the way to do it ? Setting
> the PYTHONPATH to include that site-packages directory
> ? Or some other way ? And are there any issues that
> may arise as a result of this ? Such as conflicts
> between versions of different libraries and the
> language, etc. ?

Binary module compatibility between different Python versions is "unclear" to 
me, so I always say that you should only use PyQt with the particular version 
of Python is was built against.

Phil





More information about the Python-list mailing list