尝试使用pip:SyntaxError将python2.7.0升级到python2.7.3;把蟒蛇2和蟒蛇3搞混了?
我在尝试使用pip:SyntaxError将python2.7.0升级到python2.7.3;把蟒蛇2和蟒蛇3搞混了?,python,pip,Python,Pip,我在/local/gerrit/python2.7中的virtualenv中安装了Python 2.7.0。我想将其升级到Python 2.7.3。我试图使用pip来实现这一点,但不知何故,它似乎混淆了python2和python3: $ pip install --upgrade 'python>=2.7,<2.7.99' Downloading/unpacking python>=2.7,<2.7.99 from http://www.python.org/ftp/p
/local/gerrit/python2.7
中的virtualenv中安装了Python 2.7.0。我想将其升级到Python 2.7.3。我试图使用pip来实现这一点,但不知何故,它似乎混淆了python2和python3:
$ pip install --upgrade 'python>=2.7,<2.7.99'
Downloading/unpacking python>=2.7,<2.7.99 from http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
Running setup.py egg_info for package python
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/local/gerrit/python2.7/build/python/setup.py", line 1804
exec(f.read(), globals(), fficonfig)
SyntaxError: unqualified exec is not allowed in function 'configure_ctypes' it contains a nested function with free variables
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/local/gerrit/python2.7/build/python/setup.py", line 1804
exec(f.read(), globals(), fficonfig)
SyntaxError: unqualified exec is not allowed in function 'configure_ctypes' it contains a nested function with free variables
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /local/gerrit/python2.7/build/python
Storing complete log in /storage4/home/gerrit/.pip/pip.log
$pip install--upgrade'python>=2.7,您可能需要使用类似的工具来管理同一台机器上的多个python安装
然后,当您使用像virtualenv这样的东西时,您会希望将它们指向您这样安装的二进制文件,这样您就有了一个与python的特定副本一起工作的virtualenv
virtualenv-p/path/to/python
另一个选项是pythonz的替代品。它的优点是不依赖Python本身。不确定它应该在这里还是在超级用户上。