我想学习python,所以我得到python3.2.2并安装在ubuntu10上。我们知道ubuntu已经预装了python2.6。于是删除旧链接,新建一个python3.2.2的链接,一切OK。
现在,我想安装 easy_install,我按照网站上的步骤操作。
sudo wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
发生错误:
xx@ubuntu:/usr/local/lib/python2.6/dist-packages$ python ez_setup.py
File "ez_setup.py", line 106
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
消息显示:我正在使用python2.6 !!!怎么回事,我一直喜欢python3.2.2,所以我查看了当前的pyton版本。
xx@ubuntu:/usr/local/lib/python2.6/dist-packages$ python
Python 3.2.2 (default, Mar 9 2012, 07:38:22)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
显示我现在使用的是python 3.2.2。那么,如何更改以安装 ez_setup.py?
谢谢。
最佳答案
好像是easy_install的版本问题。 Serverfault 中有一个类似的线程。检查这个:
https://serverfault.com/questions/73741/easy-installing-under-different-python-version
情况类似,但需要安装旧版本。
关于python3.2.2安装easy_install报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9644498/