我是python的新手,正在使用pip下载和安装软件包。我跑我的命令窗口中下面的代码,它抛出一个错误使用pip安装matplotlib给出错误
pip install matplotlib
而且过程开始为
Collecting matplotlib
Using cached matplotlib-1.5.3-cp27-cp27m-win32.whl
Collecting numpy>=1.6 (from matplotlib)
Using cached numpy-1.11.2-cp27-none-win32.whl
Collecting python-dateutil (from matplotlib)
Using cached python_dateutil-2.5.3-py2.py3-none-any.whl
Collecting cycler (from matplotlib)
Using cached cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,>=1.5.6 (from matplotlib)
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Collecting pytz (from matplotlib)
Using cached pytz-2016.7-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->matplotlib)
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: numpy, six, python-dateutil, cycler, pyparsing, pytz, matplotlib
Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "c:\python27\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "c:\python27\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\python27\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "c:\python27\lib\site-packages\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\python27\lib\site-packages\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "c:\python27\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'c:\\python27\\Lib\\site-packages\\numpy\\core\\multiarray.pyd'
,并让这些追踪误差。我无法弄清楚这些错误是什么以及如何解决它们。请帮忙。它完美的工作,直到收集包,但在安装时抛出错误。
PIP试图说“嗨,我下载了所有的软件包,但是我无法运行他们的安装脚本。我有权限在该文件夹中运行脚本吗?” –
这通常发生在你已经有一个运行python的实例,就像试图在word中打开一个word文件时重命名一样,它不起作用。关闭所有Python程序和解释器,然后重试。你在普通PC上使用它吗?如果是这样,我会建议你下载蟒蛇的Anaconda发行版。它包含大部分软件包,'matplotlib'就是其中之一。 –
我想这是问题所在。我重新启动cmd并通过使用'pip download matplotlib == 1.5.3'手动下载版本,然后'pip install matplotlib == 1.5.3'感谢您的帮助@NeillHerbst –