1. 程式人生 > >windows下pip安裝python模組時報錯解決方法

windows下pip安裝python模組時報錯解決方法

1.使用pip安裝python模組時報錯如下
Exception:
Traceback (most recent call last):
File “C:\Program Files\Python36\lib\shutil.py”, line 544, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] 拒絕訪問。: ‘c:\program files\python36\lib\site-packages\pip-9.0.3.dist-info\description.rst’ -> ‘C:\Users\admin\AppData\Local\Temp\pip-w3lb4uc3-uninstall\program files\python36\lib\site-packages\pip-9.0.3.dist-info\description.rst’

During handling of the above exception, another exception occurred:

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 778, in install
requirement.uninstall(auto_confirm=True)
File “C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File “C:\Program Files\Python36\lib\site-packages\pip\req\req_uninstall.py”, line 115, in remove
renames(path, new_path)
File “C:\Program Files\Python36\lib\site-packages\pip\utils_init

_.py”, line 267, in renames
shutil.move(old, new)
File “C:\Program Files\Python36\lib\shutil.py”, line 559, in move
os.unlink(src)
PermissionError: [WinError 5] 拒絕訪問。: ‘c:\program files\python36\lib\site-packages\pip-9.0.3.dist-info\description.rst’
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the ‘python -m pip install --upgrade pip’ command.

2.該報錯系許可權問題
1 首先切換到c:\program files\目錄下,
2 我們滑鼠右擊python35這個目錄,點選 屬性 ,
3 首先切換到 安全 這個大標題下面,選中當前登陸的使用者,然後再點選編輯,編輯完以後不要忘記點選應用,
3.解決方法請看下方。
在這裡插入圖片描述
在這裡插入圖片描述
在這裡插入圖片描述
4.再次輸入pip安裝python模組完全沒問題的。