PIP被打破,给予许可:[WinError 32]

发布于 2025-01-24 03:52:18 字数 5001 浏览 2 评论 0 原文

我安装了 python-certifi-win32 模块(我很忙试图解决此问题,以至于我什至不记得为什么我最初安装了它)。不过,在安装它之后,我在运行PIP时开始遇到此错误(下面的扩展错误代码): permissionError:[WinError 32]该过程无法访问文件,因为另一个过程使用了该文件:'C :\\用户\\ user1 \\ appdata \\ local \\ temp \\ tmph93rz74c' 当我删除文件 c:\\ user \\ user1 \\ appdata \\ local \\ temp \\ tmp \\ tmph93rz74c 时,另一个文件在其位置弹出,仅带有不同的随机组合字母和字母和数字,错误说明了新文件名。 我不知道该如何解决,我的PIP已经好几天没有工作了。我浏览了数十页Google结果。

完整错误代码:

Traceback (most recent call last):
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module>
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
    from pip._internal.exceptions import (
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\exceptions.py", line 13, in <module>
    from pip._vendor.requests.models import Request, Response
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\__init__.py", line 135, in <module>
    from . import utils
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\utils.py", line 27, in <module>
    from . import certs
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 170, in exec_module
    notify_module_loaded(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
    return wrapped(*args, **kwargs)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
    hook(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_pip.py", line 35, in apply_patches
    import certifi
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 170, in exec_module
    notify_module_loaded(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
    return wrapped(*args, **kwargs)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
    hook(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
    certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi\core.py", line 37, in where
    _CACERT_PATH = str(_CACERT_CTX.__enter__())
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 95, in _tempfile
    os.remove(raw_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\user1\\AppData\\Local\\Temp\\tmph93rz74c'

I installed the python-certifi-win32 module (I'm so busy trying to fix this problem that I don't even remember why I originally installed it). Right after I installed it, though, I started getting this error when I run pip (extended error code below): PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\user1\\AppData\\Local\\Temp\\tmph93rz74c'
When I delete the file C:\\Users\\user1\\AppData\\Local\\Temp\\tmph93rz74c, another file pops up in its place, just with a different random combination of letters and numbers, and the error says the new file name instead.
I have no idea how to fix it, my pip hasn't been working for days. I've looked through tens of pages of google results.

Full error code:

Traceback (most recent call last):
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module>
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
    from pip._internal.exceptions import (
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\exceptions.py", line 13, in <module>
    from pip._vendor.requests.models import Request, Response
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\__init__.py", line 135, in <module>
    from . import utils
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\utils.py", line 27, in <module>
    from . import certs
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 170, in exec_module
    notify_module_loaded(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
    return wrapped(*args, **kwargs)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
    hook(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_pip.py", line 35, in apply_patches
    import certifi
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 170, in exec_module
    notify_module_loaded(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
    return wrapped(*args, **kwargs)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
    hook(module)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
    certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi\core.py", line 37, in where
    _CACERT_PATH = str(_CACERT_CTX.__enter__())
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 95, in _tempfile
    os.remove(raw_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\user1\\AppData\\Local\\Temp\\tmph93rz74c'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

与酒说心事 2025-01-31 03:52:18

安装 Python-Certifi-Win32 之后,我遇到了相同的问题。我安装了此软件包,希望解决由我们的SSL检查基础架构使用的自签名证书引起的错误。

从安装文件夹中带来 pip 返回运行状态删除 python-certifi-win32

  • 确定 pip packages的安装路径( source ):

      python -c“来自distrutils.sysconfig import get_python_lib; print(get_python_lib())”
     
  • 切换到文件夹并删除该文件夹包的文件:

      del python-certifi-win32-init.pth
    rmdir /s /q python_certifi_win32-1.6.dist-info
     

I ran into the same problem after installing python-certifi-win32. I installed this package in the hope to solve errors caused by the self-signed certificate used by our SSL Inspection infrastructure.

To bring pip back to a running state remove python-certifi-win32 from the installation folder:

  • Determine the installation path for pip packages (source):

    python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
    
  • Switch to the folder and delete the package's files:

    del python-certifi-win32-init.pth
    rmdir /s/q python_certifi_win32-1.6.dist-info
    
迟到的我 2025-01-31 03:52:18

从Python 3.9升级到Python 3.10时,我可以观察到相同的误差模式。 Python-Certifi-win32 在某些情况下似乎是故障。

Andrew Leech, python-certifi-win32 的作者“ nofollow noreferrer”>建议继续前进到他的另一个项目。 drop-in用 pip-system-certs )为我解决了所有问题。

I could observe the same error pattern when upgrading from Python 3.9 to Python 3.10. Somehow python-certifi-win32 seems to be malfunctioning in certain scenarios then.

Andrew Leech, the author of python-certifi-win32, suggests to move on to his other project pip-system-certs . Drop-in replacing the library with pip-system-certs (PyPI link) solved all issues for me.

二货你真萌 2025-01-31 03:52:18

解决此问题的唯一解决方案是从控制面板中删除Python。然后从窗口下面的地址完全删除Python文件夹


C:\ user \ user1 \ appdata \ local \ program \ python

和linux base:
/bin/python3

the only solution to this problem is to delete Python from control panel.Then completely delete the Python folder from the address below

windows:
C:\Users\user1\AppData\Local\Programs\python

and linux base:
/bin/python3

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文