[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

A more specific query ...

Gib Bogle

2/26/2010 8:46:00 PM

How can I interrogate Python to find out where it is looking to find the PyQt4
DLLs in a Windows installation? Secondarily, how is this search path set?
7 Answers

Chris Rebert

2/26/2010 9:19:00 PM

0

On Fri, Feb 26, 2010 at 12:45 PM, Gib Bogle
<g.bogle@auckland.no.spam.ac.nz> wrote:
> How can I interrogate Python to find out where it is looking to find the
> PyQt4 DLLs in a Windows installation?

import sys
print(sys.path)

Cheers,
Chris
--
http://blog.re...

Gib Bogle

2/26/2010 9:41:00 PM

0

The point of my question was that sys.path is clearly not being used in this
case. When I start Python sys.path includes D:\python26\lib\site-packages which
seems to be the Python default. Using sys.path.append I have tried adding both
D:\python26\lib\site-packages\PyQt4 and D:\python26\lib\site-packages\PyQt4\bin
to the path, but this has no effect. So far the only way I've found to make the
PyQt4 DLLs visible to Python is by copying them from PyQt4\bin into PyQt4.

I've tried adding stuff to the Windows PATH, but that has no effect.

Gib

Chris Rebert wrote:
> On Fri, Feb 26, 2010 at 12:45 PM, Gib Bogle
> <g.bogle@auckland.no.spam.ac.nz> wrote:
>> How can I interrogate Python to find out where it is looking to find the
>> PyQt4 DLLs in a Windows installation?
>
> import sys
> print(sys.path)
>
> Cheers,
> Chris
> --
> http://blog.re...

Gib Bogle

2/26/2010 9:45:00 PM

0

Chris Rebert wrote:
> On Fri, Feb 26, 2010 at 12:45 PM, Gib Bogle
> <g.bogle@auckland.no.spam.ac.nz> wrote:
>> How can I interrogate Python to find out where it is looking to find the
>> PyQt4 DLLs in a Windows installation?
>
> import sys
> print(sys.path)

Note this thread:
http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg...

I'm starting to get the impression that Windows is the 'poor relation' in the
Python family ...

Gib Bogle

2/27/2010 12:01:00 AM

0

The PyQt4 problem results from having copies of the Qt DLLs in directories that
are in the PATH, as Doug Bell discovered. In my case I have two programs that
use Qt, AMD CodeAnalyst and Matlab. If I rename BOTH these directories I can
import the PyQt4 modules.

Since this behaviour did not occur with Python 2.5 and the previous PyQt I was
using (4.5, I think), it seems that something has changed either with Python 2.6
or with PyQt 4.7.

It would be very nice to learn how to fix this without renaming directories,
since I use Matlab frequently.

Gib

Gib Bogle

2/27/2010 12:01:00 AM

0

The PyQt4 problem results from having copies of the Qt DLLs in directories that
are in the PATH, as Doug Bell discovered. In my case I have two programs that
use Qt, AMD CodeAnalyst and Matlab. If I rename BOTH these directories I can
import the PyQt4 modules.

Since this behaviour did not occur with Python 2.5 and the previous PyQt I was
using (4.5, I think), it seems that something has changed either with Python 2.6
or with PyQt 4.7.

It would be very nice to learn how to fix this without renaming directories,
since I use Matlab frequently.

Gib

Dennis Lee Bieber

2/27/2010 5:16:00 AM

0

On Sat, 27 Feb 2010 13:00:32 +1300, Gib Bogle
<g.bogle@auckland.no.spam.ac.nz> declaimed the following in
gmane.comp.python.general:

> The PyQt4 problem results from having copies of the Qt DLLs in directories that
> are in the PATH, as Doug Bell discovered. In my case I have two programs that
> use Qt, AMD CodeAnalyst and Matlab. If I rename BOTH these directories I can
> import the PyQt4 modules.
>
And where are those PATH entries relative to the Python ones? You
may have to add the Python location to PATH /before/ the AMD and Matlab
entries. {I routinely -- once a year or so -- copy the PATH environment
variable to an editor, and reorder it so that the stuff I use most
occurs earlier in the list}
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Gib Bogle

2/27/2010 6:04:00 AM

0

Dennis Lee Bieber wrote:
> On Sat, 27 Feb 2010 13:00:32 +1300, Gib Bogle
> <g.bogle@auckland.no.spam.ac.nz> declaimed the following in
> gmane.comp.python.general:
>
>> The PyQt4 problem results from having copies of the Qt DLLs in directories that
>> are in the PATH, as Doug Bell discovered. In my case I have two programs that
>> use Qt, AMD CodeAnalyst and Matlab. If I rename BOTH these directories I can
>> import the PyQt4 modules.
>>
> And where are those PATH entries relative to the Python ones? You
> may have to add the Python location to PATH /before/ the AMD and Matlab
> entries. {I routinely -- once a year or so -- copy the PATH environment
> variable to an editor, and reorder it so that the stuff I use most
> occurs earlier in the list}

Well diagnosed! The others were all system environment variables, while the
PyQt4 PATH is mine, and therefore it was placed at the end. I've taken the AMD
and Matlab PATH entries out of the system list and put them after PyQt4 in my
PATH. Now peace and harmony are restored to my Python world.

Thanks
Gib