I upgraded my python version on a Windows 2003 server from 2.4 to 2.5.
In 2.4, I can import the file "sub1.py" from the subdirectory c: \ application \ subdir \ as follows:
import sub1
while the calling script main.py, which lives in c: \ application, runs as follows:
c:\application\subdir>python ..\main.py
But in 2.5 it no longer works for me:
C:\application\subdir>python ..\main.py
Traceback (most recent call last):
File "main.py", line 3, in <module>
import sub1
ImportError: No module named sub1
Now I can put an empty file
__init__.py
in subdir and import like this:
import subdir.sub1 as sub1
Was there a change in python 2.5? This would mean that the current working directory in python 2.4 was inherited from the calling process, and in python 2.5 it is installed where the main script lives.
[Edit3]
. , , , .
[/Edit3]