我正在尝试升级matplotlib
中的Ubuntu 12.04
。当我运行命令时:
sudo pip install --upgrade matplotlib
我收到此错误:
Downloading/unpacking matplotlib
Running setup.py egg_info for package matplotlib
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24dev-r0 (/usr/lib/python2.7/dist-packages))
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24dev-r0 (/usr/lib/python2.7/dist-packages))
----------------------------------------
Command python setup.py egg_info failed with error code 2
Storing complete log in /home/gabriel/.pip/pip.log
所以我跑:
easy_install -U distribute
我得到了:
Traceback (most recent call last):
File "/home/gabriel/Enthought/Canopy_32bit/User/bin/easy_install", line 9, in <module>
load_entry_point('distribute', 'console_scripts', 'easy_install')()
File "/home/gabriel/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/setuptools-0.9.8-py2.7.egg/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/gabriel/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/setuptools-0.9.8-py2.7.egg/pkg_resources.py", line 2565, in load_entry_point
raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found
因此我的Canopy
安装无效。我现在正在使用Spyder
,因此我可以卸载Canopy
以查看是否有帮助,但命令sudo apt-get remove enthought*
和sudo apt-get remove canopy*
找不到要删除的内容。
升级matplotlib怎么办?
我按照说明从here删除了Canopy
,现在当我运行easy_install -U distribute
时,我得到了:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
我认为这与我从source ~/Enthought/Canopy_64bit/User/bin/activate
删除行~/.profile
有关。我尝试将以下命令作为sudo运行:
apt-get autoclean
apt-get clean
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get -f install
dpkg --configure -a
apt-get install --reinstall python
但这不起作用。关于如何解决这个问题的任何想法?
我尝试使用以下命令设置PYTHONHOME
:
export PYTHONHOME=/usr/lib/python2.7
现在easy_install -U distribute
返回:
ImportError: No module named site
同样的事情:
export PYTHONHOME=/usr/local/lib/python2.7
现在开始追逐那个错误。
环境:
export PYTHONHOME=/usr/lib/python2.7/
然后以sudo
:
sudo easy_install -U distribute
做了这个伎俩。然后我可以运行sudo pip install --upgrade matplotlib
。我会在一分钟内将其添加为答案。
答案 0 :(得分:5)
删除Canopy
后,我运行:
export PYTHONHOME=/usr/lib/python2.7/
sudo easy_install -U distribute
sudo pip install --upgrade matplotlib
我可以通过这种方式升级matplotlib
。