Problem loading pandas when deploying Heroku web application

Viewed 963

unfortunately I am facing problems deploying a Heroku web application. It´s jsut a simple Python dashboard based on dash by plotly, but I am a beginner and somehow it cannot upload Pandas. Please find the problem report from Heroku below. Is there any more information necessary to assess the problem?

Thanks and happy to hear your suggestions :-)

-----> Building on the Heroku-20 stack

-----> Python app detected

-----> Installing python-3.6.12

-----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2

-----> Installing SQLite3

-----> Installing requirements with pip

   Collecting Brotli==1.0.9

     Downloading Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl (357 kB)

   Collecting click==7.1.2

     Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)

   Collecting dash==1.18.1

     Downloading dash-1.18.1.tar.gz (74 kB)

   Collecting dash-core-components==1.14.1

     Downloading dash_core_components-1.14.1.tar.gz (3.5 MB)

   Collecting dash-html-components==1.1.1

     Downloading dash_html_components-1.1.1.tar.gz (188 kB)

   Collecting dash-renderer==1.8.3

     Downloading dash_renderer-1.8.3.tar.gz (1.0 MB)

   Collecting dash-table==4.11.1

     Downloading dash_table-4.11.1.tar.gz (1.8 MB)

   Collecting Flask==1.1.2

     Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)

   Collecting Flask-Compress==1.8.0

     Downloading Flask_Compress-1.8.0-py3-none-any.whl (7.2 kB)

   Collecting future==0.18.2

     Downloading future-0.18.2.tar.gz (829 kB)

   Collecting gunicorn==20.0.4

     Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)

   Collecting itsdangerous==1.1.0

     Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)

   Collecting Jinja2==2.11.2

     Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)

   Collecting MarkupSafe==1.1.1

     Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (27 kB)

   Collecting numpy==1.19.5

     Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)

   ERROR: Could not find a version that satisfies the requirement pandas==1.2.0 (from -r /tmp/build_07fd5168/requirements.txt (line 16)) (from versions: 0.1, 0.2b0, 0.2b1, 0.2, 0.3.0b0, 0.3.0b2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0rc1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0rc1, 0.8.0rc2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0rc1, 0.19.0, 0.19.1, 0.19.2, 0.20.0rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0rc1, 0.21.0, 0.21.1, 0.22.0, 0.23.0rc2, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0rc1, 0.24.0, 0.24.1, 0.24.2, 0.25.0rc0, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 1.0.0rc0, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0rc0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5)

   ERROR: No matching distribution found for pandas==1.2.0 (from -r /tmp/build_07fd5168/requirements.txt (line 16))

! Push rejected, failed to compile Python app.

! Push failed

2 Answers

What version of pandas are you using? I was using 1.2.2 when I ran into the same issue. I used pip uninstall pandas and then installed an older version, pip install pandas==1.1.5.

After updating the requirements.txt file, I was able to successfully deploy with git push heroku master

As mentioned before, downgrading the pandas version for the highest version available in Heroku for the selected runtime works (in your case, pandas==1.1.5).

You can also consider upgrading the Python runtime version from 3.6 to 3.8 or 3.9, where pandas==1.3.0 is available. This is described here.

Related