ModuleNotFoundError: No module named 'sklearn' and 'matplotlib'

Hello! Here are the exact messages that appeared in the log.

ERROR: Could not find a version that satisfies the requirement twint==2.1.21
ERROR: No matching distribution found for twint==2.1.21
ModuleNotFoundError: No module named ‘twint’

I tried to uninstall my current twint package to reinstall the 2.1.20 version but it still did not work. :((

What is the error message in the log during deployment?

Here.

ERROR: Could not find a version that satisfies the requirement twint==2.1.21
ERROR: No matching distribution found for twint==2.1.21
[manager] Python dependencies were installed from requirements.txt using pip.
[client] Spinning up manager process...
[manager] Processed dependencies!
2021-04-08 13:15:51.032 An update to the [server] config option section was detected. To have these changes be reflected, please restart streamlit.
2021-04-08 13:15:51.170 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py", line 333, in _run_script
    exec(code, module.__dict__)
  File "/app/twitter-wordcloud-generator-using-streamlit/app.py", line 4, in <module>
    import twint as tw
ModuleNotFoundError: No module named 'twint'

As i already said, the twint version 2.1.21 ist not in the PyPI repository, therefore pip installation fails.
Try either version 2.1.20 in your requirements.txt file or omit the version number altogether.
But be aware, in the end, only version 2.1.20 is installed nonetheless.

1 Like

Hi! Both removing the version and specifying version 2.1.20 did not work for me. However, I was able to finally resolve it, by replacing the entire line in my requirements.txt file with the following:
git+https://github.com/twintproject/twint.git@origin/master#egg=twint
Thank you for your help! Next time, I’ll be more careful with the versions that I will specify.

2 Likes