在 Windows 上使用 virtualenv -p(和 virtualenvwrapper-win)的多个 python 版本 [英] Multiple python versions using virtualenv -p (and virtualenvwrapper-win) on Windows

查看:37
本文介绍了在 Windows 上使用 virtualenv -p(和 virtualenvwrapper-win)的多个 python 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用多个版本的 python(2.5 和 2.7 是我需要的,但如果有 3.2 也很好).在 Windows XP 上!

I'd like to use multiple versions of python (2.5 and 2.7 is what I need, but would be nice to have 3.2 also). On Windows XP!

我想使用 virtualenvwrapper-win 而不是 virtualenv -p

I'd like to use virtualenvwrapper-win instead of virtualenv -p

这是Unix的方法:在 virtualenv 中使用不同的 Python 版本

同样的方法是否适用于 virtualenvwrapper-win?mkvirtualenv 的源代码似乎在第 35 行将参数传递给 virtualenv:https://github.com/davidmarble/virtualenvwrapper-win/blob/master/scripts/mkvirtualenv.bat

Does the same method apply for virtualenvwrapper-win? The source for mkvirtualenv seems to pass the arguments to virtualenv on line 35: https://github.com/davidmarble/virtualenvwrapper-win/blob/master/scripts/mkvirtualenv.bat

我想我会在尝试之前问这个问题(并可能弄乱我的python环境)来询问是否有人这样做(并告诉其他人他们可以这样做).

I thought I would ask if anyone has done this (and to tell others that they can do this) by asking this question before trying it (and potentially messing up my python environment).

如果你这样做了,有什么需要注意的吗?我可以将 ActiveState python 安装用于我的第二个 python 版本吗?

If you have done this, any things to watch out for? Can I use the ActiveState python install for my second python version?

推荐答案

关于安装 python 的附加版本(多个版本),我安装了 ActiveState python 2.7 和 3.3.它们安装在 c:/区域的不同目录中.

Regarding installing additional versions (multiple versions) of python, I installed ActiveState python 2.7 and 3.3. They installed in different directories in the c:/ area.

目前,2.7 安装为默认 python.旧的python可以在命令行中作为python25访问.

Currently, 2.7 installs as the default python. The older python can be accessed as python25 in the command line.

Python 3.3 不会作为默认 Python 安装.此外,您必须使用完整路径名或自己将其添加到路径中(或在安装过程中启用该选项).

Python 3.3 does not install as the default python. Also, you have to use the full path name or add it to the path yourself (or enable the option during the install process).

不过,总的来说,使用 ActiveState 安装多个版本的 python 非常容易.

Overall, however, it was quite easy to install multiple versions of python using ActiveState.

对于虚拟环境:

python 2.7:pip 不存在时有一些问题.似乎可以通过在 virtualenv 中运行easy_install pip"来解决它.

python 2.7: had some problems with pip not present. Seems to be able to solve it by running "easy_install pip" inside the virtualenv.

python 3.3:mkvirtualenv 命令有问题:它导致 python 失败!我没有追求这个,因为我现在不需要它(但如果有人知道问题是什么以及解决方案会很棒!)

python 3.3: had problems with mkvirtualenv command: it causes python to fail! I did not pursue this since I don't need it now (but if anyone knows what the problem is and the solution that would be great!)

2013 年 10 月 13 日我不得不将 virtualenvwrapper-win 重新安装到 python27 环境中.之后,python27 virtualenv 运行正常.

Oct 13, 2013 edit: I had to re-install virtualenvwrapper-win into python27 environment. After that, python27 virtualenv was working ok.

这篇关于在 Windows 上使用 virtualenv -p(和 virtualenvwrapper-win)的多个 python 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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