【发布时间】:2014-07-29 20:58:00
【问题描述】:
我正在尝试运行virtualenvwrapper.sh 命令(即:lsvirtualenv 和 mkvirtualenv)。
我尝试使用
subprocess.call(["lsvirtualenv"])
但它似乎不起作用。它给了我以下错误信息:
Traceback (most recent call last):
File "importMaster.py", line 6, in <module>
virtualEnvs = subprocess.call(["lsvirtualenv"])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 524, in call
return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
由于这些函数位于 virtualenvwrapper.sh 文件中,我将如何在 python 脚本中引用该函数?
TIA
【问题讨论】:
标签: python python-2.7 virtualenv virtualenvwrapper