我正在为这个包尝试简单的卸载/安装,并得到以下错误,然后成功卸载。
python -m pip uninstall pywin32
...
Successfully uninstalled pywin32-227
...
PermissionError: [WinError 5] Access is denied: 'c:\\python36\\lib\\site-packages\\~0win32_system32\\pythoncom36.dll'
我试过以下几点:
20.0.2
,因为最新版本21.0.1
给出了同样的问题全文跟踪如下:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "C:\Python36\lib\site-packages\pip\_internal\commands\uninstall.py", line 82, in run
uninstall_pathset.commit()
File "C:\Python36\lib\site-packages\pip\_internal\req\req_uninstall.py", line 450, in commit
self._moved_paths.commit()
File "C:\Python36\lib\site-packages\pip\_internal\req\req_uninstall.py", line 290, in commit
save_dir.cleanup()
File "C:\Python36\lib\site-packages\pip\_internal\utils\temp_dir.py", line 175, in cleanup
rmtree(self._path)
File "C:\Python36\lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "C:\Python36\lib\site-packages\pip\_vendor\retrying.py", line 212, in call
raise attempt.get()
File "C:\Python36\lib\site-packages\pip\_vendor\retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "C:\Python36\lib\site-packages\pip\_vendor\six.py", line 703, in reraise
raise value
File "C:\Python36\lib\site-packages\pip\_vendor\retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "C:\Python36\lib\site-packages\pip\_internal\utils\misc.py", line 136, in rmtree
onerror=rmtree_errorhandler)
File "C:\Python36\lib\shutil.py", line 500, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Python36\lib\shutil.py", line 395, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Python36\lib\shutil.py", line 393, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'c:\\python36\\lib\\site-
packages\\~1win32_system32\\pythoncom36.dll'
发布于 2021-03-12 01:04:53
我在我的Windows机器上也遇到了同样的问题。
尝尝这个
pip install --user pywin32
另外,升级pip
python -m pip install -U pip --user
https://stackoverflow.com/questions/66592652
复制相似问题