2

I am trying to install distribute module one my mac. I tried pip install distribute and got the error

***"""***

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/

***"""***

I tried the program "distribute_setup.py" and by running "python3.6 install_distribute.py" but got the error "urllib.error.HTTPError: HTTP Error 403: SSL is required"

I tried updating urllib but it said it was correct. any recommendations?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
benj
  • 61
  • 3
  • Distribute went the way of the norwegian blue a long time ago. Why are you trying to install that? – wim Feb 12 '18 at 02:07

1 Answers1

2

The 'Distribute' module is deprecated. Its development is now part of 'Setuptools'. So, if you install 'Setuptools' you should get 'Distribute'. See:

The first link to PyPI even says that 'Distribute':

This package is a simple compatibility layer that installs Setuptools 0.7+.

So, you might have better luck by trying to install or update 'Setuptools'. To get more into it, I think there is a problem with either:

  1. Your pip version
  2. Your Python version
  3. Or, your 'Setuptools'

This is the line that I am interested in:

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

This error seems like something is trying to use a newly added feature that doesn't exist in the old version of a file. So, you probably need to update pip or 'Setuptools'.

Try:

Specifically, see this answer: https://stackoverflow.com/a/47278208/9347694

Also try,

Seems like others experienced this issue after installing Python 3.6. Are you sure you are using pip3? Is pip updated? Do you have 'Seyuptools' installed properly?

coltoneakins
  • 849
  • 6
  • 14