使用传递不同 python 版本的 virtualenvwrapper-win 时出错 [英] Error using virtualenvwrapper-win passing in different python version

查看:22
本文介绍了使用传递不同 python 版本的 virtualenvwrapper-win 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 python 3.4 和 2.7,它们的路径是 C:\python34 和 C:\python27.在尝试使用 python 2.7 创建 virtualenv 时,我收到以下错误:

I have python 3.4 and 2.7 installed, the paths to those are C:\python34 and C:\python27. In attempting to make a virtualenv using python 2.7 I get the following errors:

    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.

这里它说:

如果你使用多个版本的python,你可以使用单独的项目pywin在它们之间切换.这是我为 Windows 命令行和 MSYS/MINGW32 编写的轻量级 python 2.5-3.3 启动器和切换器.它类似于 python 3.3 中可用的 py.exe 启动器/切换器,但使用基本的 Windows 批处理脚本和支持 MSYS/MINGW32 的 shell 脚本编写.我使用 msysgit 中的 bash 和命令行 shell 工具,基于 MSYS/MINGW32,在 Windows 上完成我的大部分 Python 开发.

If you use several versions of python, you can switch between them using a separate project pywin. It’s a lightweight python 2.5-3.3 launcher and switcher I wrote for the Windows command line and MSYS/MINGW32. It’s similar to the py.exe launcher/switcher available in python 3.3, but written with basic Windows batch scripts and a shell script for MSYS/MINGW32 support. I use bash and command line shell tools from msysgit, based on MSYS/MINGW32, to do most of my python development on Windows.

我有 pywin,但不知道如何使用它来设置具有不同 python 版本的 virtualenv.

I have pywin but don't know how to set up a virtualenv with a different python version using that.

我不确定我的问题是什么,任何帮助将不胜感激.

I'm not sure what my problem is, any help would be appreciated.

我应该补充一点,我可以使用 python 2.7 使用 virtualenv,而不使用 virtualenvwrapper-win.

I should add that I CAN use virtualenv using python 2.7 without using virtualenvwrapper-win.

推荐答案

我今天正在努力解决这个问题.您需要指定 python.exe 文件.

I was struggling with this problem today. You need to specify the python.exe file.

mkvirtualenv -p C:/Python27/python.exe myenv

希望有帮助!

这篇关于使用传递不同 python 版本的 virtualenvwrapper-win 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆