[ python-Bugs-1174795 ] PYTHONPATH is not working

SourceForge.net noreply at sourceforge.net
Fri Apr 1 14:49:32 CEST 2005


Bugs item #1174795, was opened at 2005-04-01 15:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1174795&group_id=5470

Category: Windows
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexander Belchenko (bialix)
Assigned to: Nobody/Anonymous (nobody)
Summary: PYTHONPATH is not working

Initial Comment:
When I run python for interpreting script in form:
> python somescript.py
I got error:
python: can't open file 'somescript.py': [Errno 2] No
such file or directory

I set environment variable PYTHONPATH to
'C:\Python24\Scripts'. In directory C:\Python24\Scripts
I place script 'hello.py' with content:
print 'Hello'

This script simply prints 'Hello' word on the screen.
When I run script with command:
> python c:\python24\scripts\hello.py
all works right and prints 'Hello'. When I run script
with command 'python hello.py' I have above mentioned
error:

C:\>python hello.py
python: can't open file 'hello.py': [Errno 2] No such
file or directory

I check that this directory appear in sys.path when
invoking python in interpreter session:

C:\>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import sys
>>> sys.path
['', 'C:\Python24\Scripts', 'C:\Python24',
'C:\WINNT\system32\python24.zip
', 'C:\', 'C:\Python24\DLLs', 'C:\Python24\lib',
'C:\Python24\lib\plat-w
in', 'C:\Python24\lib\lib-tk',
'C:\Python24\lib\site-packages', 'C:\Pytho
n24\lib\site-packages\win32',
'C:\Python24\lib\site-packages\win32\lib',
 'C:\Python24\lib\site-packages\Pythonwin']
>>> import hello
Hello
>>>

As you see sys.path contain path to directory
'C:\Python24\Scripts' but nevertheless I cannot run
my script hello.py simply type 'python hello.py'

Changing of case of chars in string
'C:\Python24\Scripts' did not solved problem. 

This error has been reproduced on Windows 2000 SP4,
Windows XP SP1, Windows 98 SE.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1174795&group_id=5470


More information about the Python-bugs-list mailing list