I m 采用Fedora 15 64bit 和 python 2.7
When I run python test.py
from command line it works well
but when I run subprocess.call(["python","test.py"])
from another python module I get
File "/usr/lib64/python2.7/site.py", line 557, in <module>
main()
File "/usr/lib64/python2.7/site.py", line 539, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib64/python2.7/site.py", line 268, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib64/python2.7/site.py", line 243, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib64/python2.7/site.py", line 233, in getuserbase
USER_BASE = get_config_var( userbase )
File "/usr/lib64/python2.7/sysconfig.py", line 535, in get_config_var
return get_config_vars().get(name)
File "/usr/lib64/python2.7/sysconfig.py", line 434, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib64/python2.7/sysconfig.py", line 287, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/local/lib64/python2.7/config/Makefile (No such file or directory)
我怎么能够确定这一点?
UPDATE:这段 st指我从Eclipse手中拿到的文字。
- when I run test.py from CL - it works
- when I run script containing
subprocess.call(["python","test.py"])
from CL - it also works - when I run script containing
subprocess.call(["python","test.py"])
from Eclipse - it fails