[Tutor] help with setting Python Path under WinMe (original) (raw)
Brian van den Broek bvande at po-box.mcgill.ca
Fri Jul 9 00:38:10 CEST 2004
- Previous message: [Tutor] Parsing XML with minidom - problem solved
- Next message: Fwd: Re: [Tutor] global variables and getting/setting controlvalues/variables between frames??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
I'm feeling pretty lame about it :-( but I cannot figure out how to configure my Python Path as I'd like. I am using Python 2.3.4 under Windows Me. My Python installation is on my C: partition and I have my own Python files on my D: partition.
I want to add the two directories:
D:\Python Files\MyModules D:\Python Files
in that order to the end of my Python Path. (This preference is explained below.)
I have seen the advice for Windows users to employ the Environment Settings tab of the Control Panel->System, but Windows Me does not appear to offer this.
I tried running regedit and searching the registry for PythonPath, and the only relevant key I found was:
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.3\PythonPath which was set to ('<' added for email):
<"C:\PYTHON23\Lib;C:\PYTHON23\DLLs;C:\PYTHON23\Lib\lib-tk">
I tried both of the following additions to that key (rebooting after each change):
<"C:\PYTHON23\Lib;C:\PYTHON23\DLLs;C:\PYTHON23\Lib\lib-tk;D:\Python Files\MyModules;D:\Python Files">
<"C:\PYTHON23\Lib;C:\PYTHON23\DLLs;C:\PYTHON23\Lib\lib-tk;D:\Python1\MyModu1;D:\Python~1">
In each case when I tested, I got:
IDLE 1.0.3
import sys for i in sys.path: print i
C:\PYTHON23\Lib\idlelib C:\WINDOWS\SYSTEM\PYTHON23.zip C:\Python23 C:\PYTHON23\DLLs C:\PYTHON23\lib C:\PYTHON23\lib\plat-win C:\PYTHON23\lib\lib-tk C:\PYTHON23\Lib\site-packages\win32 C:\PYTHON23\Lib\site-packages\win32\lib C:\PYTHON23\Lib\site-packages\Pythonwin C:\PYTHON23\lib\site-packages
So, no effect. (This is exactly what I had before making any changes at all.)
I then tried modifying my autoexec.bat to include the line:
SET PYTHONPATH=D:\Python1\MyModu1;D:\Python~1
On reboot, this resulted in:
IDLE 1.0.3
import sys for i in sys.path: print i
C:\PYTHON23\Lib\idlelib
C:\Python23
D:\Python1\MyModu1
D:\Python~1
C:\WINDOWS\SYSTEM\PYTHON23.zip
C:\PYTHON23\DLLs
C:\PYTHON23\lib
C:\PYTHON23\lib\plat-win
C:\PYTHON23\lib\lib-tk
C:\PYTHON23\Lib\site-packages\win32
C:\PYTHON23\Lib\site-packages\win32\lib
C:\PYTHON23\Lib\site-packages\Pythonwin
C:\PYTHON23\lib\site-packages
This works in that it lets me import my own files. But, as I said, I want my additions to appear at the end of my PythonPath. I am a bit concerned that I might save foo.py to one of the dirs I added where there is a foo.py already in existence further down the path. If I were to later run a python prog which wanted to import foo.py from one of those subsequent directories, I worry that it could well take me a long time to work out what the error was. I certainly don't know the contents of these dirs so as to be sure of avoiding a conflict, and checking each time seems a bit much.
Am I worrying for nothing? It does seem to me that there ought to be a way to do what I want, though.
(As a side issue, I am also puzzled as to why the change to autoexec.bat switched the order of C:\Python23 and C:\WINDOWS\SYSTEM\PYTHON23.zip.)
Thanks for any suggestions and best to all,
Brian vdB
- Previous message: [Tutor] Parsing XML with minidom - problem solved
- Next message: Fwd: Re: [Tutor] global variables and getting/setting controlvalues/variables between frames??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]