Matplotlib pyplot问题:导入错误:无法导入名称'_macosx';

Matplotlib pyplot问题:导入错误:无法导入名称'_macosx';,matplotlib,backend,Matplotlib,Backend,所以我正试图在我的ubuntu系统上开始使用python中的numpy和matplotlib。请注意,我使用的是通过Python 3上的Anaconda安装的Jupyter笔记本。我可以使用,没有问题 import maplotlib 但如果我试图让pyplot加载 import matplotlib.pyplot as plt 我得到这个错误 ImportError Traceback (most recent call last

所以我正试图在我的ubuntu系统上开始使用python中的numpy和matplotlib。请注意,我使用的是通过Python 3上的Anaconda安装的Jupyter笔记本。我可以使用,没有问题

import maplotlib
但如果我试图让pyplot加载

import matplotlib.pyplot as plt
我得到这个错误

ImportError                               Traceback (most recent call last)
<ipython-input-50-a641f3b4a5f4> in <module>()
  4 #from matplotlib.backends import _macosx
  5 import matplotlib.backends
----> 6 import matplotlib.pyplot as plt
  7 
  8 # I'm adjusting this matplotlib call to fix a bug, copying the way mpl is called in the header

/media/Data/Programs/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py in <module>()
112 
113 from matplotlib.backends import pylab_setup
--> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
115 
116 _IP_REGISTERED = None

/media/Data/Programs/anaconda3/lib/python3.5/site-packages/matplotlib/backends/__init__.py in pylab_setup()
 30     # imports. 0 means only perform absolute imports.
 31     backend_mod = __import__(backend_name,
---> 32                              globals(),locals(),[backend_name],0)
 33 
 34     # Things we pull in from all backends

/media/Data/Programs/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_macosx.py in <module>()
 22 
 23 import matplotlib
---> 24 from matplotlib.backends import _macosx
 25 
 26 
ImportError: cannot import name '_macosx'
pip install --upgrade matplotlib
Collecting matplotlib
  Using cached matplotlib-2.0.0-1-cp35-cp35m-manylinux1_x86_64.whl
Requirement already up-to-date: pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /media/Data/Programs/anaconda3/lib/python3.5/site-packages (from matplotlib)
Collecting numpy>=1.7.1 (from matplotlib)
Using cached numpy-1.12.0-cp35-cp35m-manylinux1_x86_64.whl
Requirement already up-to-date: cycler>=0.10 in /media/Data/Programs/anaconda3/lib/python3.5/site-packages (from matplotlib)
Requirement already up-to-date: python-dateutil in /media/Data/Programs/anaconda3/lib/python3.5/site-packages (from matplotlib)
Requirement already up-to-date: pytz in /media/Data/Programs/anaconda3/lib/python3.5/site-packages (from matplotlib)
Requirement already up-to-date: six>=1.10 in /media/Data/Programs/anaconda3/lib/python3.5/site-packages (from matplotlib)
Installing collected packages: numpy, matplotlib
Found existing installation: numpy 1.11.1
Uninstalling numpy-1.11.1:
Exception:
Traceback (most recent call last):
File "/media/Data/Programs/anaconda3/lib/python3.5/shutil.py", line 538, in move
os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/media/Data/Programs/anaconda3/lib/python3.5/site-packages/numpy' -> '/tmp/pip-nkep4vpy-uninstall/media/Data/Programs/anaconda3/lib/python3.5/site-packages/numpy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/media/Data/Programs/anaconda3/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/media/Data/Programs/anaconda3/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/media/Data/Programs/anaconda3/lib/python3.5/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/media/Data/Programs/anaconda3/lib/python3.5/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/media/Data/Programs/anaconda3/lib/python3.5/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/media/Data/Programs/anaconda3/lib/python3.5/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/media/Data/Programs/anaconda3/lib/python3.5/shutil.py", line 550, in move
rmtree(src)
File "/media/Data/Programs/anaconda3/lib/python3.5/shutil.py", line 474, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/media/Data/Programs/anaconda3/lib/python3.5/shutil.py", line 416, in _rmtree_safe_fd
onerror(os.rmdir, fullname, sys.exc_info())
File "/media/Data/Programs/anaconda3/lib/python3.5/shutil.py", line 414, in _rmtree_safe_fd
os.rmdir(name, dir_fd=topfd)
OSError: [Errno 39] Directory not empty: 'fft'