Heroku setuptools error importing Feature

excited truck

I am trying to follow this tutorial by getting the app online on heroku, after cloning the repository and git push heroku deploy:master,

I get this error:

      Downloading MarkupSafe-1.0.tar.gz (14 kB)
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cssmcnfg/MarkupSafe/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cssmcnfg/MarkupSafe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_f6vu552
remote:                 cwd: /tmp/pip-install-cssmcnfg/MarkupSafe/
remote:            Complete output (5 lines):
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-install-cssmcnfg/MarkupSafe/setup.py", line 6, in <module>
remote:                from setuptools import setup, Extension, Feature
remote:            ImportError: cannot import name 'Feature'
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to flask-microblogf.
remote: 

Somethings I have tried:

I am quite a novice at coding in general, but hope I have conveyed the issue. Thanks a lot! :slight_smile:

It might be coming from markupsafe, try bumping the version

Hey I tried doing that as suggested by changing the markup version to 1.1.1 on the requirements.txt. However things aren’t looking good still. Any idea how to implement , "we can work around this by pinning setuptools to the last working version 45.3.0" ?

I think that just refers to markupsafe pinning their own dependencies to that version. But looking at the posts later on I thought it was fixed in 1.1.1.

What error are you getting now, the same one?

1 Like

yup, same as before. pushing the modified version in the procfile yields the same error

Not sure what the issue is then. This PR also seems to suggest that bumping MarkupSafe to 1.1.1 should fix it.

Maybe it has to do with the python version heroku is using? You might try Specifying a Python Runtime and using 3.8

Thanks! turns out I dont know how to commit changes, but now i do and this helped a lot. Thank you!!

1 Like