Python subprocess.Popen()调用在命令行中运行,但在Eclipse中不运行

时间:2015-03-20 08:05:19

标签: eclipse python-2.7 subprocess

我在Eclipse中使用subprocess.Popen()有一个非常奇怪的行为。对不起,我无法提供太多有用的代码,因为它是在商业程序中实现的。 但它很简单:在我的脚本中,通过subprocess.Popen()调用可执行文件。通过命令行手动调用它。在命令行中运行Python脚本也可以。使用Eclipse(PyDev,Python2.7)时,我得到以下错误跟踪

Traceback (most recent call last):
File "/usr/lib64/python2.7/site.py", line 564, in <module>
  main()
File "/usr/lib64/python2.7/site.py", line 546, in main
  known_paths = addusersitepackages(known_paths)
File "/usr/lib64/python2.7/site.py", line 276, in addusersitepackages
  user_site = getusersitepackages(kind)
File "/usr/lib64/python2.7/site.py", line 244, in getusersitepackages
  user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib64/python2.7/site.py", line 230, in getuserbase
  from sysconfig import get_config_var
File "/usr/lib64/python2.7/sysconfig.py", line 10, in <module>
  'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
AttributeError: 'module' object has no attribute 'lib'

我已经检查了所有已知的环境变量并使它们相等(sys.path,os.environ)。问题仍然存在。还有什么其他原因?

提前致谢。

0 个答案:

没有答案