简体   繁体   English

Python 推送到 Heroku 失败

[英]Python push fails to Heroku

I'm developing a Reddit bot using PRAW that I'm trying to push to Heroku.我正在使用 PRAW 开发一个 Reddit 机器人,我正试图将其推送到 Heroku。 When I run git push heroku master , I get this error:当我运行git push heroku master ,出现此错误:

Counting objects: 40, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (30/30), done.
Writing objects: 100% (40/40), 4.13 KiB | 1.38 MiB/s, done.
Total 40 (delta 14), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.7.1
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting altgraph==0.10.2 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/10/3d/3d8e01dee1379d3250ece6ef9d01292200c1c07086749014a15b7ac01d59/altgraph-0.10.2.tar.gz (481kB)
remote:        Collecting bdist-mpkg==0.5.0 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/b5/98/940f1281edc6091ebbbe1ffac4800cef7dec5bccb64ea2dc3e3a9c6d6974/bdist_mpkg-0.5.0.tar.gz
remote:        Collecting certifi==2018.10.15 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl (146kB)
remote:        Collecting chardet==3.0.4 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 4))
remote:          Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote:        Collecting decorator==4.0.11 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 5))
remote:          Downloading https://files.pythonhosted.org/packages/00/cc/dd79ea98a0ff5a01d714c37eddd99cd0a71557113f1511921d1ef9a083b8/decorator-4.0.11-py2.py3-none-any.whl
remote:        Collecting idna==2.7 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 6))
remote:          Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
remote:        Collecting macholib==1.5.1 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 7))
remote:          Downloading https://files.pythonhosted.org/packages/f9/12/2a830b5f3e024c50e051f5563eb4fcd61450661d1e41109d6024c8306217/macholib-1.5.1.tar.gz (454kB)
remote:        Collecting modulegraph==0.10.4 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 8))
remote:          Downloading https://files.pythonhosted.org/packages/30/84/c9a58f832e7722747dc3dfddb1a07d5761930f0b01e39060f61a5e2a112e/modulegraph-0.10.4.tar.gz (532kB)
remote:        Collecting pbr==5.1.1 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 9))
remote:          Downloading https://files.pythonhosted.org/packages/f3/04/fddc1c2dd75b256eda4d360024692231a2c19a0c61ad7f4a162407c1ab58/pbr-5.1.1-py2.py3-none-any.whl (106kB)
remote:        Collecting praw==6.0.0 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 10))
remote:          Downloading https://files.pythonhosted.org/packages/a4/d7/0c7fb864ab9469f2964b2787910c78ade6d98c2d1710df1deab61beb99a1/praw-6.0.0-py2.py3-none-any.whl (99kB)
remote:        Collecting prawcore==1.0.0 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 11))
remote:          Downloading https://files.pythonhosted.org/packages/cd/6d/4bf4d65d4771b15c70284c0626d24f230a5de6edac75c446fd22008ddbf6/prawcore-1.0.0-py2.py3-none-any.whl
remote:        Collecting py2app==0.7.3 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 12))
remote:          Downloading https://files.pythonhosted.org/packages/69/37/96be6fba838ef465c48ad701c9243ba9a61b09307c8b463e984fa40d9fee/py2app-0.7.3.tar.gz (1.2MB)
remote:        Collecting pyobjc-core==2.5.1 (from -r /tmp/build_3d8b2e5ccf0b321df85ebefdb32059e1/requirements.txt (line 13))
remote:          Downloading https://files.pythonhosted.org/packages/0c/92/51c58aa948bcd4e28b24db694fa94d67b996a041e555c9887a43fe6b794c/pyobjc-core-2.5.1.tar.gz (2.1MB)
remote:            Complete output from command python setup.py egg_info:
remote:            You're not running on MacOS X, and don't use GNUstep
remote:            I don't know how to build PyObjC on such a platform.
remote:            Please read the ReadMe.
remote:            
remote:            ObjC runtime not found
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-s91svvwa/pyobjc-core/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to calm-fjord-72549.
remote: 
To https://git.heroku.com/calm-fjord-72549.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/calm-fjord-72549.git'

I've searched Google repeatedly, and it looks like a lot of people are having this issue, but none of their solutions worked for me.我反复搜索了谷歌,看起来很多人都遇到了这个问题,但他们的解决方案都没有对我有用。 I think it has something to do with Python versions.我认为这与 Python 版本有关。

It looks like you're on MacOS and trying to have your Heroku Dyno install packages that aren't compatable with it.看起来您在 MacOS 上并试图让您的 Heroku Dyno 安装与其不兼容的软件包。 Just delete the following three dependencies from your requirements.txt file and try running git push heroku master again and it should resolve the issue:只需从您的 requirements.txt 文件中删除以下三个依赖项并再次尝试运行git push heroku master ,它应该可以解决问题:

pyobjc-core  
pyobjc-framework-Cocoa 
pyobjc-framework-Quartz

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

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