473,772 Members | 3,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where python looks for path

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


Apr 8 '06 #1
2 1344
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


Apr 8 '06 #2
Hi,

I had to move the dlls from pywin32_system3 2 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


Apr 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8593
by: Pierre Rouleau | last post by:
I can't remember where/how sys.path is set (aside from the automatically loaded site.py) and i get a strange entry in it. Can anyone remind me where/how to control sys.path on a Win32 machine (i'm running XP on the one where the issue arises). I can't figure out why the 'C:\WINDOWS\System32\python23.zip' entry is inside sys.path. That file/dir does not exist on the disk. Could a failing (crashing) Pythonwin installation caused that? ...
699
34232
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
0
2416
by: Chris McKeever | last post by:
I am trying to modify the Mailman Python code to stop mapping MIME-types and use the extension of the attachment instead. I am pretty much clueless as to what I need to do here, but I think I have narrowed it down to the Scrubber.py file.. If this seems like a quick step me through, I would be very appreciative, could get you something on your Amazon wish-list (that is me on my knees begging).. From just my basic understanding, it...
3
9734
by: Stephen Ferg | last post by:
I need a little help here. I'm developing some introductory material on Python for non-programmers. The first draft includes this statement. Is this correct? ----------------------------------------------------------------- When loading modules, Python looks for modules in the following places in the following order:
4
1688
by: Helmut Jarausch | last post by:
Hi, when I say e.g. help('try') in an interactive Python (or idle) session I get Sorry, topic and keyword documentation is not available because the Python HTML documentation files could not be found. If you have installed them, please set the environment variable PYTHONDOCS to indicate their location. So, what's the canonical installation location for the HTML documentation files
1
2095
by: | last post by:
Hello, I tried to build Python 2.4.1 on a Reliant Unix system. Just after the python executable program has been built, I get the following error: ==== begin make output === CC -W1 -Blargedynsym -o python \ Modules/python.o \ libpython2.4.a -lresolv -lsocket -lnsl -ldl -lm
10
2347
by: Daniel Mark | last post by:
Hello all: I have set the PATH for Python as follows: My Computer->Properties->Advanced->Environment Variables->System Variables->Path ....; C:\Program Files\Python24; Then I try to run python under command line
1
1834
by: arorap | last post by:
Hi, I recently setup mod_python successfully and things work smooth. However, I do not remember telling mod_python where to find Python installation. There's not environment variable which gives that information. As such how does mod_python know where to find Python ? When I print sys.path in my scripts it contains my python installation folder. I'm wondering how does Apache/mod_python get this information ?
8
1584
by: jmDesktop | last post by:
I have been to the main python site, but am still confused. I have been using .net, so it may be obvious how to do this to everyone else. I am aware there are various frameworks (Django, Pylons, etc.), but I would like to know how to create web pages without these. If I have mod_python or fastcgi on apache, where do I start? I don't have clue where to begin to create a web page from scratch in python. I am sure I will want to access...
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.