当我尝试安装matplotlib时 输入" pip install matplotlib"
它不断抛出以下错误消息。任何人都可以帮助我吗?
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 646, in install
**kwargs
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/wheel.py", line 339, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
os.utime(destfile, (st.st_atime, st.st_mtime))
OSError: [Errno 1] Operation not permitted: '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytz/__init__.py'
答案 0 :(得分:0)
我正在使用OS X El Captain并遇到同样的问题。 我用过: -
conda install -c conda-forge matplotlib=1.5.2
Matplot lib已安装且没有导入错误。但是仍然存在与pyplot相关的错误,我猜这更像是OS X El Captain兼容性问题。
您可以在此处找到与错误相关的更多信息,也可以帮助我解决错误: -
Ipython/ pylab/ matplotlib installation and initialization error
答案 1 :(得分:-1)
sudo pip install matplotlib
为我解决!