✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Heroku Deploy Error: ModuleNotFoundError: No module named 'sklearn'

ModuleNotFoundError is generally fixed by adding sklearn=0.23.1 in requirements.txt. However, when I add it, I receive this error:

ERROR: No matching distribution found for sklearn==0.23.1

Traceback -

2020-06-07T13:52:21.250973+00:00 app[web.1]: from return_leads import top_leads

2020-06-07T13:52:21.250973+00:00 app[web.1]: File "/app/return_leads.py", line 16, in <module>

2020-06-07T13:52:21.250973+00:00 app[web.1]: import sklearn

2020-06-07T13:52:21.250978+00:00 app[web.1]: ModuleNotFoundError: No module named 'sklearn'

sklearn is how it’s imported, but you must

pip install scikit-learn

And similarly specify scikit-learn in your requirements.