Issue deploying streamlit app

ImportError: cannot import name ‘Feature’ from ‘setuptools’

Hi @tony_kungu, welcome to the Streamlit community!! :wave: :partying_face:

When I forked and deployed your repo, these are the errors I saw in the console:

Collecting Jinja2==2.6
  Downloading Jinja2-2.6.tar.gz (389 kB)
    e[35mERRORe[0m: Command errored out with exit status 1:
     command: /home/appuser/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s02vpoiv/jinja2_63292e5b7b0547fc92d84ed1276fbbb5/'"'"'; __file__='"'"'/tmp/pip-install-s02vpoiv/jinja2_63292e5b7b0547fc92d84ed1276fbbb5/'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code ='"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hjms9vcc
         cwd: /tmp/pip-install-s02vpoiv/jinja2_63292e5b7b0547fc92d84ed1276fbbb5/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-s02vpoiv/jinja2_63292e5b7b0547fc92d84ed1276fbbb5/", line 40, in <module>
        from setuptools import setup, Extension, Feature
    ImportError: cannot import name 'Feature' from 'setuptools' (/home/appuser/venv/lib/python3.7/site-packages/setuptools/
e[35mWARNINGe[0m: Discarding (from Command errored out with exit status 1: python egg_info Check the logs for full command output.
e[36mINFOe[0m: pip is looking at multiple versions of camelot-py to determine which version is compatible with other requirements. This could take a while.

e[35mERRORe[0m: Could not find a version that satisfies the requirement Jinja2==2.6 (from camelot) (from versions: 2.0rc1, 2.0, 2.1, 2.1.1, 2.2, 2.2.1, 2.3, 2.3.1, 2.4, 2.4.1, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.6, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.8, 2.8.1, 2.9, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.10, 2.10.1, 2.10.2, 2.10.3, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 3.0.0a1, 3.0.0rc1, 3.0.0rc2, 3.0.0, 3.0.1)
e[35mERRORe[0m: No matching distribution found for Jinja2==2.6
e[35mWARNINGe[0m: You are using pip version 21.1.1; however, version 21.2.4 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
e[32m[manager] e[0minstaller returned a non-zero exit code
e[32m[manager] e[0mError during processing dependencies! Please fix the error and push an update, or try restarting the app.
e[32m[manager] e[0minstaller returned a non-zero exit code

It looks like your requirements.txt file contains few incorrect/misspelled Python dependencies and omits opencv-python-headless, a required dependency.

If you read the installation instructions for camelot-py, you’ll see that what you need to include in your requirements file in-place of lines 7, 8, 11 is camelot-py[base]. Replace the contents of your requirements.txt file with the following to fix your dependency errors:


Once you do that, you will likely run into the following error:

2021-09-08 11:27:01.573 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/", line 350, in _run_script
    exec(code, module.__dict__)
  File "/app/analytical-tool/", line 9, in <module>
  File "/app/analytical-tool/", line 9, in page_1'/home/kosh/Desktop/g.png')
  File "/home/appuser/venv/lib/python3.7/site-packages/PIL/", line 2968, in open
    fp =, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/kosh/Desktop/g.png'

To fix this, I would recommend uploading the image files to your repo and replacing the image filepaths in your scripts.

Happy Streamlit’ing! :balloon:

Thanks, it worked perfectly.

1 Like