我是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 –