Where python looks for path

Discussion in 'Python' started by Philippe Martin, Apr 8, 2006.

  1. Hi,

    I am currently packaging python and a few libraries: PyWin32, PySerial, PIL,
    wxPython, HTML generator, numarray for U3 distribution.

    Basically that means that the complete system initially in $path1\host will
    be moved dynamically to $path2\at execution.


    To take PIL as an example, I notice when I launch Idle in a "relative"
    manner: I am in $path1\host that $path1\host\Lib\site-packages\PIL is in
    the sys.path before I do anything.

    I notice that there is a PIL.pch file in site-packages:

    Q1) is that read by python ?


    On the other hand, even after appending all I can think of in sys.path, I
    still get an error (cannot find module) trying to load win32com.client: it
    fails in the win32api import in win32com.client.

    pywin32.pch is there.

    I think all the .dlls are there also, so I'm a bit confused.

    Q2) what should I be looking for ?


    Also, I seemed to notice in the past that modules (my own) not listed in any
    __init__.py where found under Linux but not Windows for which I had to
    upgrade my __init__.py.


    Q3: is that true ?


    Regards,

    Philippe
     
    Philippe Martin, Apr 8, 2006
    #1
    1. Advertising

  2. PS: I forgot to say that on the win32api import I get a "DLL load failed"

    Philippe


    Philippe Martin wrote:

    > Hi,
    >
    > I am currently packaging python and a few libraries: PyWin32, PySerial,
    > PIL, wxPython, HTML generator, numarray for U3 distribution.
    >
    > Basically that means that the complete system initially in $path1\host
    > will be moved dynamically to $path2\at execution.
    >
    >
    > To take PIL as an example, I notice when I launch Idle in a "relative"
    > manner: I am in $path1\host that $path1\host\Lib\site-packages\PIL is in
    > the sys.path before I do anything.
    >
    > I notice that there is a PIL.pch file in site-packages:
    >
    > Q1) is that read by python ?
    >
    >
    > On the other hand, even after appending all I can think of in sys.path, I
    > still get an error (cannot find module) trying to load win32com.client: it
    > fails in the win32api import in win32com.client.
    >
    > pywin32.pch is there.
    >
    > I think all the .dlls are there also, so I'm a bit confused.
    >
    > Q2) what should I be looking for ?
    >
    >
    > Also, I seemed to notice in the past that modules (my own) not listed in
    > any __init__.py where found under Linux but not Windows for which I had to
    > upgrade my __init__.py.
    >
    >
    > Q3: is that true ?
    >
    >
    > Regards,
    >
    > Philippe
     
    Philippe Martin, Apr 8, 2006
    #2
    1. Advertising

  3. Hi,

    I had to move the dlls from pywin32_system32 to where python.exe is.

    PS: if someone has a great desire to have another library included in the
    package, let me know.

    Regards,

    Philippe



    Philippe Martin wrote:

    > Hi,
    >
    > I am currently packaging python and a few libraries: PyWin32, PySerial,
    > PIL, wxPython, HTML generator, numarray for U3 distribution.
    >
    > Basically that means that the complete system initially in $path1\host
    > will be moved dynamically to $path2\at execution.
    >
    >
    > To take PIL as an example, I notice when I launch Idle in a "relative"
    > manner: I am in $path1\host that $path1\host\Lib\site-packages\PIL is in
    > the sys.path before I do anything.
    >
    > I notice that there is a PIL.pch file in site-packages:
    >
    > Q1) is that read by python ?
    >
    >
    > On the other hand, even after appending all I can think of in sys.path, I
    > still get an error (cannot find module) trying to load win32com.client: it
    > fails in the win32api import in win32com.client.
    >
    > pywin32.pch is there.
    >
    > I think all the .dlls are there also, so I'm a bit confused.
    >
    > Q2) what should I be looking for ?
    >
    >
    > Also, I seemed to notice in the past that modules (my own) not listed in
    > any __init__.py where found under Linux but not Windows for which I had to
    > upgrade my __init__.py.
    >
    >
    > Q3: is that true ?
    >
    >
    > Regards,
    >
    > Philippe
     
    Philippe Martin, Apr 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oren Tirosh
    Replies:
    6
    Views:
    1,774
    Oren Tirosh
    Dec 18, 2003
  2. Thomas Moore
    Replies:
    1
    Views:
    309
  3. iu2

    What Python looks like

    iu2, Aug 4, 2008, in forum: Python
    Replies:
    9
    Views:
    714
    Paddy
    Aug 6, 2008
  4. Chris Withers
    Replies:
    0
    Views:
    176
    Chris Withers
    Jan 16, 2012
  5. Terry Reedy
    Replies:
    4
    Views:
    189
    Vinay Sajip
    Jan 29, 2012
Loading...

Share This Page