You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed matplotlib and scikit-bio via conda. An import error listed below occurred when I imported. Appreciate any help to solve it.
Python 2.7.11 |Anaconda 2.4.0 (64-bit)| (default, Dec 6 2015, 18:08:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
import skbio
Traceback (most recent call last):
File "", line 1, in
File "/home/fzeng/anaconda/lib/python2.7/site-packages/skbio/init.py", line 14, in
import skbio.io # noqa
File "/home/fzeng/anaconda/lib/python2.7/site-packages/skbio/io/init.py", line 230, in
import_module('skbio.io.format.ordination')
File "/home/fzeng/anaconda/lib/python2.7/importlib/init.py", line 37, in import_module import(name)
File "/home/fzeng/anaconda/lib/python2.7/site-packages/skbio/io/format/ordination.py", line 195, in
from skbio.stats.ordination import OrdinationResults
File "/home/fzeng/anaconda/lib/python2.7/site-packages/skbio/stats/ordination/init.py", line 115, in
from ._correspondence_analysis import CA
File "/home/fzeng/anaconda/lib/python2.7/site-packages/skbio/stats/ordination/_correspondence_analysis.py", line 13, in
from ._base import Ordination, OrdinationResults
File "/home/fzeng/anaconda/lib/python2.7/site-packages/skbio/stats/ordination/_base.py", line 17, in
from mpl_toolkits.mplot3d import Axes3D
File "/home/fzeng/anaconda/lib/python2.7/site-packages/mpl_toolkits/mplot3d/init.py", line 4, in
from matplotlib.externals import six
ImportError: No module named externals
It sounds like you somehow have two versions of matplotlib installed on top of each other.
I suggest uninstalling matplotlib with conda and then making sure that all leftovers of matplotlib and mpl_toolkits are removed from /home/fzeng/anaconda/lib/python2.7/site-packages and then try again.
Hi Nielsen, it works following your suggestions and thanks a lot. May I ask one more question that how do you find out there are two conflicting versions of matplotlib?
The six code was moved to external in 1.5 so it seems likely that some of your code is 1.5 and some of it older.
mpl_toolkits is a namespace package to allow basemap and other external packages to be installed into it. This makes it unreliable to uninstall when changing versions. I hope to be able to change this in a future version to avoid namespace packages.
I am having this problem now, and re-installing matplotlib didn't help... Anything I might be missing? Ubuntu 16.04, installation of python 3.5 parallel with 2.7 (tried reinstalling maptlotlib in both installations).
s1529682:~$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpl_toolkits.axes_grid1 import ImageGrid
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/mpl_toolkits/axes_grid1/__init__.py", line 4, in <module>
from matplotlib.externals import six
ImportError: No module named 'matplotlib.externals'
have you tried removing the matplotlib package provided through Ubuntu? The
error seems to suggest that the mpl_toolkits is getting picked up in the
dist-packages folder, which seems to be old.
On Tue, May 30, 2017 at 2:54 PM, Ilya Flyamer ***@***.***> wrote:
I am having this problem now, and re-installing matplotlib didn't help...
Anything I might be missing? Ubuntu 16.04, installation of python 3.5
parallel with 2.7 (tried reinstalling maptlotlib in both installations).
s1529682:~$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpl_toolkits.axes_grid1 import ImageGrid
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/mpl_toolkits/axes_grid1/__init__.py", line 4, in <module>
from matplotlib.externals import six
ImportError: No module named 'matplotlib.externals'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5633 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-HQn9XiONOK3QSi6bw-wURMALHJJks5r_GXOgaJpZM4Gwx3s>
.
Activity
jenshnielsen commentedon Dec 8, 2015
It sounds like you somehow have two versions of matplotlib installed on top of each other.
I suggest uninstalling matplotlib with conda and then making sure that all leftovers of matplotlib and mpl_toolkits are removed from
/home/fzeng/anaconda/lib/python2.7/site-packagesand then try again.homopolymer commentedon Dec 8, 2015
Hi Nielsen, it works following your suggestions and thanks a lot. May I ask one more question that how do you find out there are two conflicting versions of matplotlib?
jenshnielsen commentedon Dec 8, 2015
It was just a guess. But there were two reasons
Phlya commentedon May 30, 2017
I am having this problem now, and re-installing matplotlib didn't help... Anything I might be missing? Ubuntu 16.04, installation of python 3.5 parallel with 2.7 (tried reinstalling maptlotlib in both installations).
WeatherGod commentedon May 30, 2017
Phlya commentedon May 31, 2017
Ah, good idea, thanks, this helped!