我无法安装matplotlib。我使用的是覆盆子pi 3b。
我正在使用此
pip --no-cache-dir install matplotlib
安装matplotlib。一开始就没关系。但在最后部分, 我收到这个错误:
Exception:
Traceback (most recent call last):
File "/home/pi/.local/lib/python2.7/site-packages/pip/basecommand.py",
line 215, in main
status = self.run(options, args)
File "/home/pi/.local/lib/python2.7/site-
packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/pi/.local/lib/python2.7/site-packages/pip/req/req_set.py",
line 784, in install
**kwargs
File "/home/pi/.local/lib/python2.7/site-
packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/pi/.local/lib/python2.7/site-
packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/pi/.local/lib/python2.7/site-packages/pip/wheel.py", line
345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/pi/.local/lib/python2.7/site-packages/pip/wheel.py", line
316, in clobber
ensure_dir(destdir)
File "/home/pi/.local/lib/python2.7/site-packages/pip/utils/__init__.py",
line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-
packages/backports.functools_lru_cache-1.5.dist-info'
答案 0 :(得分:0)
如果要在系统范围内安装或创建virualenv并使用sudo -H pip install matplotlib
将其安装在virtualenv上,请使用pip install matplotlib
。