我正在尝试在我的mac上安装分发模块。我尝试了pip安装分发并得到错误
***"""***
Collecting distribute
Using cached distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/
***"""***
我尝试了程序"distribute_setup.py"和运行"python3.6install_distribute.py"但得到错误"urllib. error.HTTPError:HTTP错误403:SSL是必需的"
我尝试更新urllib,但它说这是正确的。
“分发”模块已弃用。它的开发现在是“Setuptools”的一部分。因此,如果您安装“Setuptools”,您应该获得“分发”。请参阅:
PyPI的第一个链接甚至说“分发”:
这个包是一个安装Setuptools 0.7的简单兼容层。
因此,您可能会通过尝试安装或更新“Setuptools”来获得更好的运气。为了深入了解它,我认为其中任何一个都存在问题:
这是我感兴趣的一行:
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
此错误似乎是试图使用旧版本文件中不存在的新添加功能。因此,您可能需要更新pip或“Setuptools”。
尝试:
具体看这个答案:https://stackoverflow.com/a/47278208/9347694
也试试,
似乎其他人在安装Python3.6后遇到了这个问题。你确定你正在使用pip 3吗?pip更新了吗?你是否正确安装了“Seyuptools”?