help! - cmd line interpreter gone "dumb"

Peter Hansen peter at engcorp.com
Sun Jul 6 22:48:26 EDT 2003


Tim wrote:
> 
> For the record...
> 
> if I don't define any paths for Python, it naturally knows were to go for
> the core + libraries.
> but, if you define the PYTHONPATH in the environment--only those directories
> are searched. It was probably the late night that had me forget when I
> changed things (funny--its seemed to work for a long while, but the changes
> may not have been reflected if I had the same command window open the entire
> evening (this was the case, I think).

This wasn't likely the cause of all your problems.  Try defining
that environment variable again, and check whether "import sys"
really does give a syntax error.  If it does, it's something else,
because all PYTHONPATH should do is let you add more stuff to
the standard search path.  (If you can get import sys to work,
type "sys.path" to see what is defined, and you'll see that the
stuff in PYTHONPATH merely goes at the front, just after the ''
item which means the directory from which the script runs.)

If you are really getting a syntax error, paste the full traceback
into another posting so we can see what it is.  Maybe you were
typing with CAPSLOCK on?  Or you had a module of your own in the
current directory, called sys.py, and it contained a syntax error,
so when you imported it you got confused?  Definitely something 
other than PYTHONPATH, I think.

-Peter




More information about the Python-list mailing list