PYTHONPATH problem 
Author Message
 PYTHONPATH problem

The PYTHONPATH environment variable does not appear to be working on my
system. I've got it set to

C:\>echo %PYTHONPATH%
C:\Python20\modules;C:\DanielK\python

It works ok if my current working directory is 'C:\DanielK\python' (where
the module is located), but when I try to run a module from anywhere else, I
get

C:\>python ptest.py
python: can't open file 'ptest.py'

For now, I am specifying the full path to get around the problem.

I'm on Win2000 and PYTHONPATH is set as a global environment variable.

Any ideas?

Daniel Klein



Thu, 22 May 2003 03:00:00 GMT  
 PYTHONPATH problem
PYTHONPATH isn't used to resolve the script name on the command line. It's
used to figure out where to find a module in an import statement inside your
python code. It doesn't work like you seem to be expecting.

-Chris


Quote:
> The PYTHONPATH environment variable does not appear to be working on my
> system. I've got it set to

> C:\>echo %PYTHONPATH%
> C:\Python20\modules;C:\DanielK\python

> It works ok if my current working directory is 'C:\DanielK\python' (where
> the module is located), but when I try to run a module from anywhere else,
I
> get

> C:\>python ptest.py
> python: can't open file 'ptest.py'

> For now, I am specifying the full path to get around the problem.

> I'm on Win2000 and PYTHONPATH is set as a global environment variable.

> Any ideas?

> Daniel Klein



Thu, 22 May 2003 03:00:00 GMT  
 PYTHONPATH problem
Thanks, I kinda surmised that. Just thought I'd ask anyway.

Dan


Quote:
> PYTHONPATH isn't used to resolve the script name on the command line. It's
> used to figure out where to find a module in an import statement inside
your
> python code. It doesn't work like you seem to be expecting.

> -Chris



> > The PYTHONPATH environment variable does not appear to be working on my
> > system. I've got it set to

> > C:\>echo %PYTHONPATH%
> > C:\Python20\modules;C:\DanielK\python

> > It works ok if my current working directory is 'C:\DanielK\python'
(where
> > the module is located), but when I try to run a module from anywhere
else,
> I
> > get

> > C:\>python ptest.py
> > python: can't open file 'ptest.py'

> > For now, I am specifying the full path to get around the problem.

> > I'm on Win2000 and PYTHONPATH is set as a global environment variable.

> > Any ideas?

> > Daniel Klein



Thu, 22 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Configuring Python on Win98 - problem with pythonpath

2. Newbie problem with PYTHONPATH

3. pywintypes and PYTHONPATH/Registry problem?

4. Problems with PYTHONPATH in generated Makefile for 2.1

5. Newbie question to setting PYTHONPATH environment var on Linux

6. PYTHONPATH on the Windows Registry?

7. How is sys.path initialized without a PYTHONPATH?

8. PythonPath for ASP

9. PYTHONPATH

10. IIS forgetting PythonPath?

11. Pythonpath in Windows

12. ActiveState: PythonWin not using PythonPath for import?

 

 
Powered by phpBB® Forum Software