ModuleNotFoundError: No module named ‘pip‘

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 <module>
    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安装文件的用户权限有问题

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值