gpt4 book ai didi

macos - 导入错误:无法从 'SourceDistribution' 导入名称 'pip._internal.distributions.source'

转载 作者:行者123 更新时间:2023-12-04 22:49:45 24 4
gpt4 key购买 nike

pip3 install不工作,而且 pip3 也无法从 pip20.0 降级到 pip19:

Rayaans-MacBook-Pro:~ rayaangrewal$ pip3 install 
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/pip3", line 10, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 20, in <module>
from pip._internal.operations.prepare import RequirementPreparer
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 16, in <module>
from pip._internal.distributions import (
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/distributions/__init__.py", line 1, in <module>
from pip._internal.distributions.source import SourceDistribution
ImportError: cannot import name 'SourceDistribution' from 'pip._internal.distributions.source' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/distributions/source/__init__.py)

最佳答案

这是 pip 中的一个错误20.0;见 https://github.com/pypa/pip/issues/7620

已在 pip 中修复20.0.1。升级到 20.0.1+ 或降级到 19.3.1。获取 get-pip.py并运行

python get-pip.py

或者
python get-pip.py pip==19.3.1

关于macos - 导入错误:无法从 'SourceDistribution' 导入名称 'pip._internal.distributions.source',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59842600/

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