pip“拒绝访问”,求处理办法

C:\Users\jyz_1>pip uninstall pip
Uninstalling pip-19.2.3:
  Would remove:
    c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip-19.2.3.dist-info\*
    c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\*
    c:\program files (x86)\microsoft visual studio\shared\python37_64\scripts\pip.exe
    c:\program files (x86)\microsoft visual studio\shared\python37_64\scripts\pip3.7.exe
    c:\program files (x86)\microsoft visual studio\shared\python37_64\scripts\pip3.exe
Proceed (y/n)? y
ERROR: Exception:
Traceback (most recent call last):
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\shutil.py", line 566, in move
    os.rename(src, real_dst)
PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\pip-19.2.3.dist-info\\' -> 'C:\\Users\\jyz_1\\AppData\\Local\\Temp\\pip-uninstall-zze2xy20'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\_internal\commands\uninstall.py", line 75, in run
    auto_confirm=options.yes, verbose=self.verbosity > 0,
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\_internal\req\req_install.py", line 831, in uninstall
    uninstalled_pathset.remove(auto_confirm, verbose)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\_internal\req\req_uninstall.py", line 388, in remove
    moved.stash(path)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\_internal\req\req_uninstall.py", line 277, in stash
    renames(path, new_path)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\pip\_internal\utils\misc.py", line 402, in renames
    shutil.move(old, new)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\shutil.py", line 578, in move
    rmtree(src)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\shutil.py", line 516, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\shutil.py", line 400, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\shutil.py", line 398, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\pip-19.2.3.dist-info\\entry_points.txt'

C:\Users\jyz_1>










已管理员身份运行命令提示符。 再运行 pip