Não é possível atualizar o matplotlib no Ubuntu 12.04 com o Canopy instalado

Estou tentando atualizarmatplotlib emUbuntu 12.04. Quando eu executo o comando:

sudo pip install --upgrade matplotlib

Eu recebo este erro:

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

Então eu corro:

easy_install -U distribute

e eu recebo:

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

Então, há algo que não funciona com o meuCanopy instalar. estou a usarSpyder agora para que eu possa desinstalarCanopy para ver se isso ajuda, mas os comandossudo apt-get remove enthought* esudo apt-get remove canopy* Não encontre nada para remover.

O que posso fazer para atualizar o matplotlib?

Adicionar

Eu segui as instruções para removerCanopy deAqui e agora quando eu corroeasy_install -U distribute Eu recebo:

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

que eu acredito que está relacionado comigo, excluindo a linhasource ~/Enthought/Canopy_64bit/User/bin/activate de~/.profile. Eu tentei executar os seguintes comandos como 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

mas isso não funcionou. Alguma ideia de como consertar isso?

Adicione 2

Eu tentei definirPYTHONHOME com o comando:

export PYTHONHOME=/usr/lib/python2.7

e agoraeasy_install -U distribute retorna:

ImportError: No module named site

Mesma coisa com:

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

Então, agora fora para perseguir esse erro.

Adicione 3

Configuração:

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

e, em seguida, executando o comando comosudo:

sudo easy_install -U distribute

fez o truque. Eu poderia então corrersudo pip install --upgrade matplotlib. Vou adicionar isso como uma resposta em um minuto.

questionAnswers(1)

yourAnswerToTheQuestion