Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong version of mpl_toolkits imported when installing mpl with python setup.py install --user #2590

Closed
twmr opened this issue Nov 12, 2013 · 3 comments

Comments

@twmr
Copy link
Contributor

twmr commented Nov 12, 2013

I'm on a247d93.

I have a system-wide installation of matplotlib in /usr/lib64/.... and a local one in ~/.local/lib/... The local one was installed using make && python setup.py build && python setup.py install --user. The problem I see is that the system-wide mpl_toolkits package is imported if I try to import mpl_toolkits in a python shell. However, matplotlib is imported from the local installation:

>>> import matplotlib
>>> matplotlib.__file__
'/home/thomas/.local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/__init__.pyc'
>>> import mpl_toolkits
>>> mpl_toolkits.__path__
['/usr/lib64/python2.7/site-packages/mpl_toolkits']

The mpl_toolkits is actually installed in the local installation:

ls /home/thomas/.local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg
EGG-INFO  matplotlib  mpl_toolkits  pylab.py  pylab.pyc
@tacaswell
Copy link
Member

Is this related to #2611

@mdboom
Copy link
Member

mdboom commented Jan 24, 2014

Is the global version of matplotlib pre-1.3.x? Prior to matplotlib 1.3.x, mpl_toolkits was not a namespace package, but now it is. I suspect having a "real" package trumps the magic that makes namespace packages work.

There are some solutions:

  1. Upgrade your global matplotlib install to 1.3 or later

  2. Use a virtualenv --no-system-site-packages and then install matplotlib into that rather than setup.py install --user.

I'm closing this (though we can keep the discussion going) because I don't know if there's anything matplotlib can do from our end.

@mdboom mdboom closed this as completed Jan 24, 2014
@twmr
Copy link
Contributor Author

twmr commented Jan 24, 2014

Probably there was a pre 1.3 version of matplotlib installed. Right now 1.3.0 is installed and I don't have the problem anymore.

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants