gpt4 book ai didi

python - 无法在安装了 Canopy 的 Ubuntu 12.04 中升级 matplotlib

转载 作者:行者123 更新时间:2023-12-02 08:38:01 24 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 12.04 中升级 matplotlib。当我运行命令时:

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 distribution 时,我得到:

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

我认为这与我从 ~/.profile 中删除 source ~/Enthought/Canopy_64bit/User/bin/activate 行有关。我尝试以 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

但这没有用。关于如何解决这个问题有什么想法吗?

<小时/>

添加 2

我尝试使用以下命令设置PYTHONHOME:

export PYTHONHOME=/usr/lib/python2.7

现在 easy_install -U distribution 返回:

ImportError: No module named site

同样的事情:

export PYTHONHOME=/usr/local/lib/python2.7

现在就去追寻那个错误。

<小时/>

添加 3

设置:

export PYTHONHOME=/usr/lib/python2.7/

然后以 sudo 身份运行命令:

sudo easy_install -U distribute

成功了。然后我可以运行 sudo pip install --upgrade matplotlib 。我会在一分钟内将其添加为答案。

最佳答案

删除Canopy后我运行:

export PYTHONHOME=/usr/lib/python2.7/
sudo easy_install -U distribute
sudo pip install --upgrade matplotlib

我可以通过这种方式升级 matplotlib

关于python - 无法在安装了 Canopy 的 Ubuntu 12.04 中升级 matplotlib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18064159/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com