Pipenv не может установить boto3 на удаленный сервер (Heroku) - PullRequest
1 голос
/ 28 марта 2020

Я успешно развернул свой django проект, затем я хотел использовать AWS S3 для обслуживания stati c файлов. Поэтому я установил необходимые пакеты, и все работало локально. Но теперь, когда я пытаюсь git push heroku master, происходит сбой со следующей трассировкой:

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'

Ранее у меня была похожая проблема, когда я пытался установить psycopg2 локально, но после многих попыток все еще не нашел ничего, кроме обходного пути ( установив psycopg2-бинарный вместо). Так что и здесь я чувствую себя немного безнадежно. Я попробовал pipenv sync, pipenv update, в конце концов я перезапустил новый venv, но это не помогло. Если я пытаюсь установить boto3 через heroku bash, это работает. Но это не решает проблему, так как файлы заблокированы.

1 Ответ

1 голос
/ 28 марта 2020

django - хранилища зависят от версии 1.4.4 и выше для boto3, но pipenv устанавливает версию 1.12.31, выпущенную 28 марта. Так что может быть несоответствие кэша между heroku и pypi.org. так что вы можете понизить версию boto3, вручную установив boto3 с помощью следующей команды

pipenv install "boto=1.4.4"

Я указал 1.4.4, так как это минимальная версия, необходимая для django -storages.But Вы можете установить любую версию выше 1.4.4.

...