Pipenv fails to install boto3 on remote server (Heroku)

Andrei Osmolovskii

I deployed my django project successfully, then I wanted to use AWS S3 for serving static files. So I installed the required packages and everything worked locally. But now when I try git push heroku master it fails with the following traceback:

Writing objects: 100% (370/370), 5.85 MiB | 2.92 MiB/s, done.
Total 370 (delta 69), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.6.10
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: cp: cannot create regular file '/app/tmp/cache/.heroku/requirements.txt': No such file or directory
remote: -----> Installing python-3.6.9
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote:        Installing dependencies from Pipfile.lock (acd4c8)…
remote:        An error occurred while installing boto3==1.12.31! Will try again.
remote:        Installing initially–failed dependencies…
remote:        Collecting boto3==1.12.31 
remote:          Using cached https://files.pythonhosted.org/packages/2a/4f/3facbb42e8d07db1ef9b8cefb28dd1dbfcd52a8e32a0323d57f59b10e147/boto3-1.12.31-py2.py3-none-any.whl
remote:        
remote:        THESE PACKAGES DO NOT MATCH THE HASHES FROM Pipfile.lock!. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
remote:            boto3==1.12.31 from https://files.pythonhosted.org/packages/2a/4f/3facbb42e8d07db1ef9b8cefb28dd1dbfcd52a8e32a0323d57f59b10e147/boto3-1.12.31-py2.py3-none-any.whl#sha256=8bf7e3611d46e8214bf225169ac55de762d9d341514f81ebae885dd601138fcf (from -r /tmp/pipenv-sdy5o9v6-requirements/pipenv-k_8vold6-requirement.txt (line 1)):
remote:                Expected sha256 913fc7bbb9df147ed6fa0bd2b391469652ee8cad3e26ca2355e6ff774d9516fb
remote:                     Got        8bf7e3611d46e8214bf225169ac55de762d9d341514f81ebae885dd601138fcf
remote:        
remote:        You are using pip version 9.0.2, however version 20.0.2 is available.
remote:        You should consider upgrading via the 'pip install --upgrade pip' command.
remote:        
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to shielded-coast-69749.
remote: 
To https://git.heroku.com/shielded-coast-69749.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shielded-coast-69749.git'

Previously I had a similar issue trying to install psycopg2 locally, but after many attempts still haven't found anything but a workaround (installing psycopg2-binary instead). So here I feel a bit hopeless too. I tried pipenv sync, pipenv update, eventually I restarted with a new venv, but it didn't help. If I try to install boto3 via heroku's bash, it works. But it doesn't solve the problem since files are locked.

LIONEL VSV

django-storages depends on boto3 version of 1.4.4 and above but pipenv installs 1.12.31 which was released on mar 28.So there might be cache mismatch between heroku and pypi.org. so u can downgrade boto3 by manually installing boto3 by using the following command

pipenv install "boto=1.4.4"

I have specified 1.4.4 as it is the minimum version required by django-storages.But u can install any version above 1.4.4.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related