无法在Ubuntu 11.4中启动多个Python程序
我最近开始使用Ubuntu系统。我是一个有一定经验的程序员,已经使用“旧版”Python好多年了。但是,在Python 3.2中,当我尝试运行从某些网站上安装的几个不同程序时,出现了类似下面的错误信息。
在这里,我试图启动IPython。但是其他程序也出现了同样的错误。
Traceback (most recent call last):
File "./ipython3", line 9, in <module>
load_entry_point('ipython==0.12', 'console_scripts', 'ipython3')()
File "/usr/local/lib/python3.2/dist-packages/distribute-0.6.24-py3.2.egg/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.2/dist-packages/distribute-0.6.24-y3.2.egg/pkg_resources.py", line 2279, in load_entry_point
raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'ipython3') not found
我在网上搜索了这个错误,发现其他用户也遇到了类似的问题,但据我所知,没有人报告过真正的解决办法。
相关问题:
1 个回答
0
我猜测你可能把不同版本的安装和简单安装搞混了。
想要更好地尝试和使用Python,最好的办法是使用一个独立的“沙盒”。通过virtualenv(这是几种方法之一),你可以这样操作:
$ virtualenv -p /usr/bin/python3.2 --distribute MYPYTHON32
Running virtualenv with interpreter /usr/bin/python3.2
New python executable in MYPYTHON32/bin/python3.2
Also creating executable in MYPYTHON32/bin/python
Installing distribute...
然后你就可以安装任何你想尝试的东西:
$ cd MYPYTHON32
$ bin/easy_install ipython
我没有遇到任何问题:
$ bin/ipython3
Python 3.2 (r32:88445, Dec 8 2011, 15:26:58)
Type "copyright", "credits" or "license" for more information.
IPython 0.12 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]:
关于virtualenv的文档会给你更多的提示。这样安装的东西就不会和系统里的Python产生冲突,而且你总是可以控制在沙盒里安装什么。