ModuleNotFoundError: No module named ‘pip‘

ModuleNotFoundError: No module named ‘pip‘,第1张

pip一段时间没用后出现这个问题,网上由解决方案

python -m ensurepip
python -m pip install --upgrade pip

但是报错

  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\lib\ensurepip\__main__.py", line 5, in
    sys.exit(ensurepip._main())
  File "C:\Python310\lib\ensurepip\__init__.py", line 277, in _main
    return _bootstrap(
  File "C:\Python310\lib\ensurepip\__init__.py", line 193, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "C:\Python310\lib\ensurepip\__init__.py", line 93, in _run_pip
    return subprocess.run([sys.executable, '-W', 'ignore::DeprecationWarning',
  File "C:\Python310\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Python310\\python.exe', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'C:\\\\Users\\\\LeeRX\\\\AppData\\\\Local\\\\Temp\\\\tmp5661mc2z\\\\setuptools-57.4.0-py3-none-any.whl\', \'C:\\\\Users\\\\LeeRX\\\\AppData\\\\Local\\\\Temp\\\\tmp5661mc2z\\\\pip-21.2.3-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'C:\\\\Users\\\\LeeRX\\\\AppData\\\\Local\\\\Temp\\\\tmp5661mc2z\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.

后来发现是python安装文件的用户权限有问题

修改用户权限为完全控制就好了。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/787069.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-05
下一篇 2022-05-05

发表评论

登录后才能评论

评论列表(0条)

保存