Python分发安装Mac

时间:2018-02-12 02:02:04

标签: python module distribute

我正在尝试安装分发模块一个我的mac。我试过pip install distribute并得到了错误

***"""***

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.6 install_distribute.py”,但收到错误“urllib.error.HTTPError:HTTP Error 403:SSL is required”

我尝试更新urllib,但它说它是正确的。有什么建议吗?

1 个答案:

答案 0 :(得分:1)

&#39;分发&#39;模块已弃用。它的发展现在是“安装工具”的一部分。因此,如果您安装了“安装工具”&#39;你应该得到&#39;分发&#39;。参见:

PyPI的第一个链接甚至表示&#39; Distribute&#39;:

  

此软件包是一个简单的兼容层,可安装Setuptools 0.7 +。

因此,您可以通过尝试安装或更新“安装工具”来获得更好的运气。为了更多地了解它,我认为存在以下任何一个问题:

  1. 您的点数版
  2. 您的Python版本
  3. 或者,您的&#39;设置工具
  4. 这是我感兴趣的一行:

    AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    

    此错误似乎正在尝试使用旧版本文件中不存在的新添加功能。因此,您可能需要更新pip或&#39; Setuptools&#39;。

    尝试:

    具体来说,请参阅此答案:https://stackoverflow.com/a/47278208/9347694

    也试试,

    在安装Python 3.6之后,似乎有人遇到过这个问题。你确定你使用的是pip3吗?点子更新了吗?你有&#39; Seyuptools&#39;安装得好吗?