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.

If scikit-learn is installed on your system, but you are still getting the “no module named ‘sklearn’” error, you may need to check if the Python path is set correctly. The Python path is a list of directories where Python looks for modules and packages. To check the Python path, you can run the following command in your terminal or command prompt:

python -c "import sys; print(sys.path)"

This will print out the directories in the Python path. Make sure that the directory where scikit-learn is installed is included in the Python path.