Message198136
Executing a script from the command prompt works if Python.exe called explicitly, doesn't work if script name only.
Example :
python.exe script.py is ok
script.py gives the following :
Traceback (most recent call last):
File "D:\soft\python\lib\site.py", line 548, in <module>
main()
File "D:\soft\python\lib\site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "D:\soft\python\lib\site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "D:\soft\python\lib\site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "D:\soft\python\lib\site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "D:\soft\python\lib\sysconfig.py", line 516, in get_config_var
return get_config_vars().get(name)
File "D:\soft\python\lib\sysconfig.py", line 449, in get_config_vars
import re
File "D:\soft\python\lib\re.py", line 105, in <module>
import sre_compile
File "D:\soft\python\lib\sre_compile.py", line 14, in <module>
import sre_parse
File "D:\soft\python\lib\sre_parse.py", line 17, in <module>
from sre_constants import *
File "D:\soft\python\lib\sre_constants.py", line 18, in <module>
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
Association of py extension to the python.exe is ok, Path contains the path for python directory (and also to \lib) and is the first dir in path.
Why is there a difference between the 2 invocations as they are calling the same exe? |
|
Date |
User |
Action |
Args |
2013-09-20 09:28:48 | tsunwell | set | recipients:
+ tsunwell |
2013-09-20 09:28:48 | tsunwell | set | messageid: <1379669328.14.0.507303810717.issue19056@psf.upfronthosting.co.za> |
2013-09-20 09:28:47 | tsunwell | link | issue19056 messages |
2013-09-20 09:28:47 | tsunwell | create | |
|