PermissionError: [Errno 13] 权限被拒绝:'C:\\Program Files\\Python35\\Lib\\site-packages\\six.py'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44044298/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 23:40:14  来源:igfitidea点击:

PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\Python35\\Lib\\site-packages\\six.py'

pythonpandasnumpypermissions

提问by Shi Jie Tio

I am using python 3.5.3, and now I want to install pandas and numpy but not able to, following is the error in cmd, anyone can help me?

我正在使用python 3.5.3,现在我想安装pandas和numpy但无法安装,以下是cmd中的错误,有人可以帮助我吗?

 C:\Program Files\Python35\Scripts>py -3.5 -m pip install pandas 

Collecting pandas
Using cached pandas-0.20.1-cp35-cp35m-win_amd64.whl
Collecting python-dateutil>=2 (from pandas)
Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
Collecting numpy>=1.7.0 (from pandas)
Using cached numpy-1.12.1-cp35-none-win_amd64.whl
Collecting pytz>=2011k (from pandas)
Using cached pytz-2017.2-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil>=2->pandas)
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, numpy, pytz, pandas
Exception:
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Program Files\Python35\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Program Files\Python35\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\Program Files\Python35\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Program Files\Python35\lib\site-packages\pip\wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Program Files\Python35\lib\shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\Program Files\Python35\Lib\site-packages\six.py'

回答by Duncan WP

As others have pointed out you need to run the command with admin privileges.

正如其他人指出的那样,您需要以管理员权限运行该命令。

How to do this variesby windows version, but on Windows 8 and 10 you can just press Windows+X (or just right-clicking the Start button). On the menu, choose “Command Prompt (Admin).”

如何执行此操作Windows 版本而异,但在 Windows 8 和 10 上,您只需按 Windows+X(或只需右键单击“开始”按钮即可)。在菜单上,选择“命令提示符(管理员)”。

回答by Mitchell van Zuylen

The command line you're using does not have access to C:\\Program Files\\Python35\\Lib\\site-packages\\six.py.

您使用的命令行无权访问C:\\Program Files\\Python35\\Lib\\site-packages\\six.py.

Run the command in a command line with administrative priveleges.

在具有管理权限的命令行中运行该命令。