我正在尝试将 virtualenv 设置为指向 Maya 2013 的可执行文件,以便我可以在 shell 中运行单元测试。Maya 使用位于/usr/autodesk/maya/bin/mayapy
. 我收到这些错误:
$ virtualenv -p /usr/autodesk/maya/bin/mayapy mayapy
Running virtualenv with interpreter /usr/autodesk/maya/bin/mayapy
PYTHONHOME is set. You *must* activate the virtualenv before using it
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 2577, in <module>
main()
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1081, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1289, in install_python
writefile(site_filename_dst, SITE_PY)
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 445, in writefile
f = open(dest, 'wb')
IOError: [Errno 2] No such file or directory: 'mayapy/lib/python26.zip/site.py'
我已经阅读了virtualenv 的页面、输出、一些像这样virtualenv -h
的基本 virtualenv 文章,并在 google 和 SO 中搜索了 virtualenv 和 maya+virtualenv 配对,但都无济于事。
这是详细的输出:
$ virtualenv -vv -p /usr/autodesk/maya/bin/mayapy mayapy
Running virtualenv with interpreter /usr/autodesk/maya/bin/mayapy
PYTHONHOME is set. You *must* activate the virtualenv before using it
Directory mayapy/lib/python2.6 already exists
Symlinking Python bootstrap modules
Cannot import bootstrap module: os
Ignoring built-in bootstrap module: posix
Cannot import bootstrap module: posixpath
Cannot import bootstrap module: nt
Cannot import bootstrap module: ntpath
Cannot import bootstrap module: genericpath
Cannot import bootstrap module: fnmatch
Cannot import bootstrap module: locale
Cannot import bootstrap module: encodings
Cannot import bootstrap module: codecs
Cannot import bootstrap module: stat
Cannot import bootstrap module: UserDict
File mayapy/lib/python2.6/lib-dynload/readline.so already exists
Cannot import bootstrap module: copy_reg
Cannot import bootstrap module: types
Cannot import bootstrap module: re
Cannot import bootstrap module: sre
Cannot import bootstrap module: sre_parse
Cannot import bootstrap module: sre_constants
Cannot import bootstrap module: sre_compile
File mayapy/lib/python2.6/lib-dynload/zlib.so already exists
Cannot import bootstrap module: warnings
Cannot import bootstrap module: linecache
Cannot import bootstrap module: _abcoll
Cannot import bootstrap module: abc
Directory mayapy/lib/python2.6/site-packages already exists
Writing mayapy/lib/python26.zip/site.py
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 2577, in <module>
main()
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1081, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1289, in install_python
writefile(site_filename_dst, SITE_PY)
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 445, in writefile
f = open(dest, 'wb')
IOError: [Errno 2] No such file or directory: 'mayapy/lib/python26.zip/site.py'