Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shackra opened this issue Mar 15, 2018 · 2 comments · May be fixed by #9
Open

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

shackra opened this issue Mar 15, 2018 · 2 comments · May be fixed by #9

Comments

@shackra
Copy link

shackra commented Mar 15, 2018

When adding you module and trying to deploy to Heroku with Python 3.6.4 I get the following error:

remote:        Collecting distribute (from scrapy-heroku==0.7.1->-r /tmp/build_a2015ad4e03aa9d149d2f49b9c840b65/requirements.txt (line 3))
remote:          Downloading distribute-0.7.3.zip (145kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-build-0ymcqp4k/distribute/setuptools/__init__.py", line 2, in <module>
remote:                from setuptools.extension import Extension, Library
remote:              File "/tmp/pip-build-0ymcqp4k/distribute/setuptools/extension.py", line 5, in <module>
remote:                from setuptools.dist import _get_unpatched
remote:              File "/tmp/pip-build-0ymcqp4k/distribute/setuptools/dist.py", line 7, in <module>
remote:                from setuptools.command.install import install
remote:              File "/tmp/pip-build-0ymcqp4k/distribute/setuptools/command/__init__.py", line 8, in <module>
remote:                from setuptools.command import install_scripts
remote:              File "/tmp/pip-build-0ymcqp4k/distribute/setuptools/command/install_scripts.py", line 3, in <module>
remote:                from pkg_resources import Distribution, PathMetadata, ensure_directory
remote:              File "/tmp/pip-build-0ymcqp4k/distribute/pkg_resources.py", line 1518, in <module>
remote:                register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
remote:            AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0ymcqp4k/distribute/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to polar-bastion-49521.

Any reason to relay on distribute?

@jdguzmans
Copy link

is this fixed?
I am encountering this error

Setup.py config

    entry_points={'scrapy': ['settings = lpricing.settings']},
    python_requires='>3.6.7',
    install_requires=__requirements

requirements.txt

Scrapy==1.7.3
scrapyd==1.0.1
scrapy-heroku==0.7.1
scrapy-magicfields==1.1.0
scrapy-splash==0.7.2
selenium==3.141.0
pyvirtualdisplay==0.2.4
xvfbwrapper==0.2.9
boto3
boto
scrapy-s3pipeline
python-dotenv

error log

-----> Python app detected
 !     Python has released a security update! Please consider upgrading to python-3.6.9
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
-----> Uninstalling stale dependencies
       Uninstalling scrapydweb-1.4.0:
         Successfully uninstalled scrapydweb-1.4.0
-----> Installing requirements with pip
       Collecting scrapyd==1.0.1 (from -r /tmp/build_00295a6bdc22e2d45bad0c62cc689436/requirements.txt (line 2))
         Downloading https://files.pythonhosted.org/packages/3a/35/bac83ece6c6849061896771a905800ac855a351aae604ad232a71a4cc8fd/scrapyd-1.0.1.tar.gz
       Collecting scrapy-heroku==0.7.1 (from -r /tmp/build_00295a6bdc22e2d45bad0c62cc689436/requirements.txt (line 3))
         Downloading https://files.pythonhosted.org/packages/3b/19/876c22d5971aa48b86f7f25ee8abd6326d48f7abf7bf20f1fb799ece95e1/scrapy-heroku-0.7.1.tar.gz
       Collecting distribute (from scrapy-heroku==0.7.1->-r /tmp/build_00295a6bdc22e2d45bad0c62cc689436/requirements.txt (line 3))
         Downloading https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip (145kB)
           Complete output from command python setup.py egg_info:
           Traceback (most recent call last):
             File "<string>", line 1, in <module>
             File "/tmp/pip-build-sem4qp6f/distribute/setuptools/__init__.py", line 2, in <module>
               from setuptools.extension import Extension, Library
             File "/tmp/pip-build-sem4qp6f/distribute/setuptools/extension.py", line 5, in <module>
               from setuptools.dist import _get_unpatched
             File "/tmp/pip-build-sem4qp6f/distribute/setuptools/dist.py", line 7, in <module>
               from setuptools.command.install import install
             File "/tmp/pip-build-sem4qp6f/distribute/setuptools/command/__init__.py", line 8, in <module>
               from setuptools.command import install_scripts
             File "/tmp/pip-build-sem4qp6f/distribute/setuptools/command/install_scripts.py", line 3, in <module>
               from pkg_resources import Distribution, PathMetadata, ensure_directory
             File "/tmp/pip-build-sem4qp6f/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 /tmp/pip-build-sem4qp6f/distribute/
 !     Push rejected, failed to compile Python app.
 !     Push failed

@secretshardul
Copy link

same error in python 3.7.5

pip install scrapy-heroku
Collecting scrapy-heroku
  Downloading https://files.pythonhosted.org/packages/3b/19/876c22d5971aa48b86f7f25ee8abd6326d48f7abf7bf20f1fb799ece95e1/scrapy-heroku-0.7.1.tar.gz
Collecting distribute (from scrapy-heroku)
  Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/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 "/tmp/pip-install-4ys75cp4/distribute/setuptools/__init__.py", line 2, in <module>
        from setuptools.extension import Extension, Library
      File "/tmp/pip-install-4ys75cp4/distribute/setuptools/extension.py", line 5, in <module>
        from setuptools.dist import _get_unpatched
      File "/tmp/pip-install-4ys75cp4/distribute/setuptools/dist.py", line 7, in <module>
        from setuptools.command.install import install
      File "/tmp/pip-install-4ys75cp4/distribute/setuptools/command/__init__.py", line 8, in <module>
        from setuptools.command import install_scripts
      File "/tmp/pip-install-4ys75cp4/distribute/setuptools/command/install_scripts.py", line 3, in <module>
        from pkg_resources import Distribution, PathMetadata, ensure_directory
      File "/tmp/pip-install-4ys75cp4/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 /tmp/pip-install-4ys75cp4/distribute/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants