windows上 python install 错误

来源:互联网 发布:java udp服务器 编辑:程序博客网 时间:2024/06/16 16:15

Windows电脑刚开始接触python的小白(比如我),用pip install xxx的时候会弹出来这样的错误
C:\Users\hds>pip3 install aiohttp
Collecting aiohttp
Using cached aiohttp-2.3.1-cp36-cp36m-win_amd64.whl
Collecting async-timeout>=1.2.0 (from aiohttp)
Using cached async_timeout-2.0.0-py3-none-any.whl
Collecting yarl>=0.11 (from aiohttp)
Using cached yarl-0.13.0-cp36-cp36m-win_amd64.whl
Collecting chardet (from aiohttp)
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting multidict>=3.0.0 (from aiohttp)
Using cached multidict-3.3.0-cp36-cp36m-win_amd64.whl
Installing collected packages: async-timeout, multidict, yarl, chardet, aiohttp
Exception:
Traceback (most recent call last):
File “c:\program files\python36\lib\site-packages\pip\basecommand.py”, line 21
5, in main
status = self.run(options, args)
File “c:\program files\python36\lib\site-packages\pip\commands\install.py”, li
ne 342, in run
prefix=options.prefix_path,
File “c:\program files\python36\lib\site-packages\pip\req\req_set.py”, line 78
4, in install
**kwargs
File “c:\program files\python36\lib\site-packages\pip\req\req_install.py”, lin
e 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”, lin
e 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\sit
e-packages\async_timeout’

解决方法

  • 根据提示找到python的安装地址,比如我的是C:\Program Files\Python36(报错信息也能看出来)

  • 选中Python36文件夹,右键属性
    Python属性

确定即可