sys.path issue in cygwin
steve at holdenweb.com
Wed Jan 24 14:42:07 CET 2007
Wang Shuhao wrote:
> I successfully built and installed Python 2.2.3 in cygwin. But there is
> something wrong in the sys.path. I use following statments for a test.
> >>> import sys
> >>> print sys.path
> ['', 'C/lib/python2.2/', 'C/lib/python2.2/plat-cygwin',
> , '\\Python24/lib/python2.2/lib-dynload']
> To keep the question simple, I've set PATH= in cygwin.bat to avoid
> python initialze sys.path from Windows' PATH environment.
> Obviously, 'C/lib/python2.2/' is a wrong path. In fact my python is
> installed in /usr/local/lib/python2.2.3. The result of the issue is that
> when you run a program python can't find the module. So what I really
> want to know is where these path came from and how to fix it.
Why "obviously"? 2.2.3 and 2.2.2 aren't meant to coexist, so one will
install over the other. So the directories you are seeing are what would
be used with standard prefix settings.
If you mean "obviously because I used a setting to configure the
prefixes for loading from a specific directory" then perhaps you are
suffering from having set your Windows PATH. If you *don't* set your
Windows PATH do you see it using the "2.2.3" variants?
Did you run "make install"?
Just a couple of random thoughts ... are you even sure that running the
"python" command does run your new 2.2.3 binary?
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Blog of Note: http://holdenweb.blogspot.com
More information about the Python-list