win系统通过pip安装requests,输入pip install requests后报错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了win系统通过pip安装requests,输入pip install requests后报错相关的知识,希望对你有一定的参考价值。

C:\Program Files\Python36\Scripts>pip install requests
Collecting requests
Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests)
Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached certifi-2018.1.18-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests)
Using cached idna-2.6-py2.py3-none-any.whl
Installing collected packages: urllib3, chardet, certifi, idna, requests
Exception:
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files\python36\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\python36\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\program files\python36\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files\python36\lib\site-packages\pip\wheel.py", line 316, in clobber
ensure_dir(destdir)
File "c:\program files\python36\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "c:\program files\python36\lib\os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\python36\\Lib\\site-packages\\urllib3'
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

参考技术A

先执行下升级pip然后再试着安装一次。

执行升级pip的命令是

python -m pip install --upgrade pip

参考技术B 你这个是没有权限吧。打开cmd窗口用管理员权限试一下。

以上是关于win系统通过pip安装requests,输入pip install requests后报错的主要内容,如果未能解决你的问题,请参考以下文章

python opencv安装教程 通过pip安装三方库

win32gui安装通过pip失败

Python-Requests库的安装和调用

windows下python3.6 通过pip安装Twisted模块报utf-8错误的解决办法

如何使用 pip 安装 requests 模块? [复制]

you-get怎么安装,我是win10系统,已经安装了python和ffmpeg