我安装了这个如何在Windows上为Python 2.4和2.5版本设置virtualenv环境?
- 在Windows 7
- 的Python 2.7.6(我的默认,安装的virtualenv)
- 的Python 2.4.4
- 的Python 2.5.4
- 的Python 2.6。 6
- 的Python 3.3.3
- 的virtualenv 1.10.1
我想测试所有这些python安装的代码。
(类似quesion Multiple python versions using virtualenv -p (and virtualenvwrapper-win) on Windows没有回答这个问题。)
这是我试过到目前为止:(!创建一个环境,但安装PY27)
Python 2.4中给出了一个语法错误:
>virtualenv -p c:\apps\Python24\python.exe env24_v
Running virtualenv with interpreter c:\apps\Python24\python.exe
File "C:\apps\Python27\lib\site-packages\virtualenv.py", line 1508
cp_or_ln = (os.symlink if symlink else copyfile)
^
SyntaxError: invalid syntax
Python 2.5的显然是不支持的(没有创建环境):
C:\Users\martin>virtualenv -p c:\apps\Python25\python.exe env25
Running virtualenv with interpreter c:\apps\Python25\python.exe
ERROR: None
ERROR: this script requires Python 2.6 or greater.
项
Python 2.6中按预期工作:
C:\Users\martin\.virtualenvs>virtualenv -p c:\apps\Python26\python.exe env26
Running virtualenv with interpreter c:\apps\Python26\python.exe
New python executable in env26\Scripts\python.exe
Installing Setuptools..............done.
Installing Pip.............done.
C:\Users\martin\.virtualenvs>env26\Scripts\activate
(env26) C:\Users\martin\.virtualenvs>python
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
的Python 2.7和3.3也正常工作。
所以我的问题是: 尽管最近的virtualenv工具不支持Python 2.4/2.5环境,是否有一个技巧来实现这一点?
嗨,你有没有发现一个解决这个问题? – Bren
尚未(掉落支持2.4/2.5该项目) – mar10