gpt4 book ai didi

python - 导入错误 : cannot import name 'PackageFinder'

转载 作者:行者123 更新时间:2023-12-03 15:25:30 34 4
gpt4 key购买 nike

更新 conda 中的所有内容后,pip 无法安装任何内容

conda update -n base conda
conda update --all

安装或升级任何东西时,显示此错误
   $ pip install --upgrade HDF5
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\pip-script.py", line 10, in <module>
sys.exit(main())
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\main.py", line 45, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\commands\__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 23, in <module>
from pip._internal.cli.req_command import RequirementCommand
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 17, in <module>
from pip._internal.index import PackageFinder
ImportError: cannot import name 'PackageFinder'

请任何帮助。
谢谢你。

最佳答案

看来this works .重新安装最新版本的 pip:

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py

完成后,删除安装脚本:

$ rm get-pip.py

关于python - 导入错误 : cannot import name 'PackageFinder' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59887436/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com