我安装了 python 3.4 和 2.7,它们的路径是 C:\python34 和 C:\python27。在尝试使用 python 2.7 创建 virtualenv 时,出现以下错误:
C:\Development>mkvirtualenv --python=C:\python27 env
Running virtualenv with interpreter C:\python27
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "C:\Python34\lib\site-packages\virtualenv.py", line 784, in main
popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
File "C:\Python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child
startupinfo)
PermissionError: [WinError 5] Access is denied
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
here它说:
如果您使用多个版本的 python,则可以使用单独的项目 pywin 在它们之间进行切换。它是我为 Windows 命令行和 MSYS/MINGW32 编写的轻量级 python 2.5-3.3 启动器和切换器。它类似于 python 3.3 中的 py.exe 启动器/切换器,但使用基本的 Windows 批处理脚本和用于 MSYS/MINGW32 支持的 shell 脚本编写。我使用 msysgit 中基于 MSYS/MINGW32 的 bash 和命令行 shell 工具在 Windows 上完成大部分 Python 开发。
我有 pywin 但不知道如何使用它来设置具有不同 python 版本的 virtualenv 。
我不确定我的问题是什么,任何帮助将不胜感激。
我应该补充一点,我可以使用 python 2.7 使用 virtualenv,而不使用 virtualenvwrapper-win。