简体   繁体   English

无法在已安装Canopy的Ubuntu 12.04中升级Matplotlib

[英]Can't upgrade matplotlib in Ubuntu 12.04 with Canopy installed

I'm trying to upgrade matplotlib in Ubuntu 12.04 . 我正在尝试在Ubuntu 12.04升级matplotlib When I run the command: 当我运行命令时:

sudo pip install --upgrade matplotlib

I get this error: 我收到此错误:

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

So I run: 所以我跑:

easy_install -U distribute

and I get: 我得到:

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

So there's something not working with my Canopy install. 因此,我的Canopy安装不起作用。 I'm using Spyder right now so I could uninstall Canopy to see if that helps, but the commands sudo apt-get remove enthought* and sudo apt-get remove canopy* find nothing to remove. 我现在正在使用Spyder所以我可以卸载Canopy看看是否有帮助,但是命令sudo apt-get remove enthought*sudo apt-get remove canopy*没有要删除的内容。

What can I do to upgrade matplotlib? 我该怎么办才能升级matplotlib?


Add

I followed the instructions to remove Canopy from here and now when I run easy_install -U distribute I get: 我按照指示从此处删除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

which I believe is related with me deleting the line source ~/Enthought/Canopy_64bit/User/bin/activate from ~/.profile . 我认为这与我从~/.profile删除行source ~/Enthought/Canopy_64bit/User/bin/activate I tried running the following commands as sudo: 我尝试以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

but that did not work. 但这没有用。 Any ideas on how to fix this? 有想法该怎么解决这个吗?


Add 2 加2

I tried setting PYTHONHOME with the command: 我尝试使用以下命令设置PYTHONHOME

export PYTHONHOME=/usr/lib/python2.7

and now easy_install -U distribute returns: 现在easy_install -U distribute返回:

ImportError: No module named site

Same thing with: 同样的事情:

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

So now off to chase that error. 所以现在开始追逐这个错误。


Add 3 加3

Setting: 设置:

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

and then running the command as sudo : 然后以sudo身份运行命令:

sudo easy_install -U distribute

did the trick. 做到了。 I could then run sudo pip install --upgrade matplotlib . 然后我可以运行sudo pip install --upgrade matplotlib I'll add this as an answer in a minute. 一分钟后,我将其添加为答案。

After removing Canopy I run: 删除Canopy我运行:

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

I could upgrade matplotlib that way. 我可以那样升级matplotlib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM