简体   繁体   English

推送到heroku失败

[英]Push to heroku fails

I am following this tutorial https://www.codementor.io/jamesezechukwu/how-to-deploy-django-app-on-heroku-dtsee04d4 for deploying my Django app to heroku. 我正在按照本教程https://www.codementor.io/jamesezechukwu/how-to-deploy-django-app-on-heroku-dtsee04d4的说明将我的Django应用程序部署到heroku。 This is my first Django app: 这是我的第一个Django应用程序:

Push rejected, failed to compile Python app. 推送被拒绝,无法编译Python应用。

I'm currently running python 3.7.0. 我目前正在运行python 3.7.0。 this is set in my runtime.txt file: python-3.7.0 这是在我的runtime.txt文件中设置的: python-3.7.0

stack trace: 堆栈跟踪:

Enumerating objects: 11614, done.
Counting objects: 100% (11614/11614), done.
Delta compression using up to 4 threads
Compressing objects: 100% (8294/8294), done.
Writing objects: 100% (11614/11614), 42.09 MiB | 3.12 MiB/s, done.
Total 11614 (delta 2534), reused 8489 (delta 2166)
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.7.3
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.7.0
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip



remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-build-r7xse4_1/django-dbbackup/setup.py", line 59, in <module>
remote:                install_requires=get_requirements(),
remote:              File "/tmp/pip-build-r7xse4_1/django-dbbackup/setup.py", line 45, in get_requirements
remote:                import pysftp  # @UnusedImport
remote:              File "/app/.heroku/python/lib/python3.7/site-packages/pysftp.py", line 10, in <module>
remote:                import paramiko
remote:              File "/app/.heroku/python/lib/python3.7/site-packages/paramiko/__init__.py", line 30, in <module>
remote:                from paramiko.transport import SecurityOptions, Transport
remote:              File "/app/.heroku/python/lib/python3.7/site-packages/paramiko/transport.py", line 61, in <module>
remote:                from paramiko.sftp_client import SFTPClient
remote:              File "/app/.heroku/python/lib/python3.7/site-packages/paramiko/sftp_client.py", line 41, in <module>
remote:                from paramiko.sftp_file import SFTPFile
remote:              File "/app/.heroku/python/lib/python3.7/site-packages/paramiko/sftp_file.py", line 66
remote:                self._close(async=True)
remote:                                ^
remote:            SyntaxError: invalid syntax
remote:            
remote:            ----------------------------------------
remote:        Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-r7xse4_1/django-dbbackup/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3pz1o34a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-r7xse4_1/django-dbbackup/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to {my_app}.
remote: 


 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/{my_app.git}'

the requirements txt file: 需求txt文件:

asn1crypto==0.24.0
astroid==1.4.9
bcrypt==3.1.4
boto==2.34.0
boto3==1.9.38
botocore==1.12.104
cffi==1.11.5
coverage==4.5.1
cryptography==2.3.1
dj-database-url==0.3.0
dj-static==0.0.6
Django==2.2.4
django-dbbackup==2.0.4
django-filter==0.8
django-jsonfield==0.9.13
django-markdown-deux==1.0.5
django-oauth-plus==2.2.8
django-oauth2-provider==0.2.6.1
django-sslify==0.2.5
django-toolbelt==0.0.1
djangorestframework==2.4.4
djangorestframework-oauth==1.0.1
docutils==0.14
ecdsa==0.13
eventlog==0.11.0
gunicorn==19.1.1
httplib2==0.9
idna==2.7
isort==4.3.9
jmespath==0.9.4
lazy-object-proxy==1.3.1
Markdown==2.5.2
markdown2==2.3.0
mccabe==0.6.1
mock==2.0.0
newrelic==2.44.0.36
numpy==1.17.0
oauth2==1.9.0.post1
pandas==0.25.0
paramiko==1.15.2
pbr==5.1.2
pgeocode==0.1.1
psycopg2==2.7.5
py-mini-racer==0.1.15
pyasn1==0.4.4
pycparser==2.18
pycrypto==2.6.1
pylint==1.6.5
PyNaCl==1.2.1
pysftp==0.2.8
pystache==0.5.4
python-dateutil==2.8.0
pytz==2018.4
requests==2.2.1
requests-toolbelt==0.8.0
rsa==3.4.2
s3transfer==0.1.13
shortuuid==0.4.0
six==1.8.0
South==0.8.4
sqlparse==0.3.0
sqreen==1.13.3
static==1.1.1
static3==0.5.1
ua-parser==0.8.0
urllib3==1.24.1
user-agents==1.1.0
wh==1.2.0
whitenoise==1.0.6
wrapt==1.11.1
xkcdpass==1.2.5

is there something I've missed? 有什么我想念的吗? im assuming its a python 3 issue 即时通讯假设它是python 3问题

The version of paramiko (1.15.2) isn't compatible with python 3.7. paramiko(1.15.2)的版本与python 3.7不兼容。 Use a newer version. 使用较新的版本。 It uses the async keyword which is reserved as argument in a function call. 它使用async关键字,该关键字在函数调用中保留为参数。

If you look at the latest version, you'll see that this particular line of code is now using async_ . 如果您查看最新版本,您会发现此特定代码现在正在使用async_

You should always use the same version of python on your local machine as on production to spot these errors earlier. 您应该始终在本地计算机上使用与生产环境相同的python版本,以更早地发现这些错误。

I also suggest you look at some of the other dependencies, your version of gunicorn is also more than 5 years old, it contains security vulnerabilities, so may some other (old) packages you're using. 我还建议您查看其他一些依赖项,您的gunicorn版本也已有5年以上的历史,它包含安全漏洞,因此您可能正在使用其他一些(旧)软件包。

Finally, use pip freeze to compare what's installed in your local virtualenv compared to requirements.txt . 最后,使用pip freeze将本地virtualenv中安装的内容与requirements.txt进行比较。 And make sure they are the same! 并确保它们相同!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM