This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tsunwell
Recipients tsunwell
Date 2013-09-20.09:28:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379669328.14.0.507303810717.issue19056@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2013-09-20 09:28:48tsunwellsetrecipients: + tsunwell
2013-09-20 09:28:48tsunwellsetmessageid: <1379669328.14.0.507303810717.issue19056@psf.upfronthosting.co.za>
2013-09-20 09:28:47tsunwelllinkissue19056 messages
2013-09-20 09:28:47tsunwellcreate