Невозможно развернуть приложение Django на Heroku: «Ошибка команды со статусом выхода 1: python setup.py egg_info. Проверьте журналы на наличие полного вывода команды». - PullRequest
0 голосов
/ 02 августа 2020

Я пытался развернуть свое приложение Django на Heroku, используя «git pu sh heroku master», когда возникла эта проблема. Полные строки ошибок приведены ниже:

Tungs-MBP:werewolf2 tungdo$ git push heroku master
Enumerating objects: 84, done.
Counting objects: 100% (84/84), done.
Delta compression using up to 8 threads
Compressing objects: 100% (81/81), done.
Writing objects: 100% (84/84), 25.04 KiB | 2.78 MiB/s, done.
Total 84 (delta 13), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:  !     Your Django version is nearing the end of its community support.
remote:  !     Upgrade to continue to receive security updates and for the best experience with Django.
remote:  !     For more information, check out https://www.djangoproject.com/download/#supported-versions
remote:        Collecting altgraph==0.10.2
remote:          Downloading altgraph-0.10.2.tar.gz (481 kB)
remote:        Collecting bdist-mpkg==0.5.0
remote:          Downloading bdist_mpkg-0.5.0.tar.gz (19 kB)
remote:        Collecting configparser==4.0.2
remote:          Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
remote:        Collecting contextlib2==0.6.0.post1
remote:          Downloading contextlib2-0.6.0.post1-py2.py3-none-any.whl (9.8 kB)
remote:        Collecting distlib==0.3.1
remote:          Downloading distlib-0.3.1-py2.py3-none-any.whl (335 kB)
remote:        Collecting Django==1.11.29
remote:          Downloading Django-1.11.29-py2.py3-none-any.whl (6.9 MB)
remote:        Collecting gunicorn==19.10.0
remote:          Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
remote:        Collecting macholib==1.5.1
remote:          Downloading macholib-1.5.1.tar.gz (454 kB)
remote:        Collecting modulegraph==0.10.4
remote:          Downloading modulegraph-0.10.4.tar.gz (532 kB)
remote:        Collecting py2app==0.7.3
remote:          Downloading py2app-0.7.3.tar.gz (1.2 MB)
remote:        Collecting pyobjc-framework-Accounts==2.5.1
remote:          Downloading pyobjc-framework-Accounts-2.5.1.tar.gz (11 kB)
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/setup.py'"'"'; __file__='"'"'/tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/pip-egg-info
remote:                 cwd: /tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/
remote:            Complete output (15 lines):
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/setup.py", line 24, in <module>
remote:                min_os_level="10.8",
remote:              File "/tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/pyobjc_setup.py", line 360, in setup
remote:                os_level = get_os_level()
remote:              File "/tmp/pip-install-m969tbqn/pyobjc-framework-Accounts/pyobjc_setup.py", line 182, in get_os_level
remote:                pl = plistlib.readPlist('/System/Library/CoreServices/SystemVersion.plist')
remote:              File "/app/.heroku/python/lib/python3.6/plistlib.py", line 162, in readPlist
remote:                with _maybe_open(pathOrFile, 'rb') as fp:
remote:              File "/app/.heroku/python/lib/python3.6/contextlib.py", line 81, in __enter__
remote:                return next(self.gen)
remote:              File "/app/.heroku/python/lib/python3.6/plistlib.py", line 120, in _maybe_open
remote:                with open(pathOrFile, mode) as fp:
remote:            FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to werewolf-boardgame.
remote: 
To https://git.heroku.com/werewolf-boardgame.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/werewolf-boardgame.git'

Я использую MacOS, если это играет какую-либо роль в этой проблеме. И вот мой репозиторий Github для этого проекта: https://github.com/donguyentung2001/Werewolf_boardgame

Спасибо за внимание!

Редактировать: я пробовал то, что рекомендовал @JBrown, но показала другая ошибка up:

Tungs-MBP:werewolf2 tungdo$ git push heroku master
Enumerating objects: 90, done.
Counting objects: 100% (90/90), done.
Delta compression using up to 8 threads
Compressing objects: 100% (87/87), done.
Writing objects: 100% (90/90), 25.47 KiB | 2.55 MiB/s, done.
Total 90 (delta 17), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:  !     Your Django version is nearing the end of its community support.
remote:  !     Upgrade to continue to receive security updates and for the best experience with Django.
remote:  !     For more information, check out https://www.djangoproject.com/download/#supported-versions
remote:        Collecting altgraph==0.10.2
remote:          Downloading altgraph-0.10.2.tar.gz (481 kB)
remote:        Collecting bdist-mpkg==0.5.0
remote:          Downloading bdist_mpkg-0.5.0.tar.gz (19 kB)
remote:        Collecting configparser==4.0.2
remote:          Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
remote:        Collecting contextlib2==0.6.0.post1
remote:          Downloading contextlib2-0.6.0.post1-py2.py3-none-any.whl (9.8 kB)
remote:        Collecting distlib==0.3.1
remote:          Downloading distlib-0.3.1-py2.py3-none-any.whl (335 kB)
remote:        Collecting Django==1.11.29
remote:          Downloading Django-1.11.29-py2.py3-none-any.whl (6.9 MB)
remote:        Collecting gunicorn==19.10.0
remote:          Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
remote:        Collecting macholib==1.5.1
remote:          Downloading macholib-1.5.1.tar.gz (454 kB)
remote:        Collecting modulegraph==0.10.4
remote:          Downloading modulegraph-0.10.4.tar.gz (532 kB)
remote:        Collecting py2app==0.7.3
remote:          Downloading py2app-0.7.3.tar.gz (1.2 MB)
remote:        Collecting pyOpenSSL==0.13.1
remote:          Downloading pyOpenSSL-0.13.1.tar.gz (254 kB)
remote:        Collecting pyparsing==2.0.1
remote:          Downloading pyparsing-2.0.1.tar.gz (1.1 MB)
remote:        Collecting python-dateutil==1.5
remote:          Downloading python-dateutil-1.5.tar.gz (233 kB)
remote:        Collecting pytz==2013.7
remote:          Downloading pytz-2013.7.tar.bz2 (177 kB)
remote:        Collecting six==1.4.1
remote:          Downloading six-1.4.1.tar.gz (21 kB)
remote:        Collecting xattr==0.6.4
remote:          Downloading xattr-0.6.4.tar.gz (15 kB)
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-j47lsvz2/xattr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-j47lsvz2/xattr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-j47lsvz2/xattr/pip-egg-info
remote:                 cwd: /tmp/pip-install-j47lsvz2/xattr/
remote:            Complete output (8 lines):
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-install-j47lsvz2/xattr/setup.py", line 3, in <module>
remote:                import ez_setup
remote:              File "/tmp/pip-install-j47lsvz2/xattr/ez_setup.py", line 106
remote:                except pkg_resources.VersionConflict, e:
remote:                                                    ^
remote:            SyntaxError: invalid syntax
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to werewolf-boardgame.
remote: 
To https://git.heroku.com/werewolf-boardgame.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/werewolf-boardgame.git'

Чтобы решить эту проблему, я следую совету Получение двух неизвестных ошибок при попытке загрузить мое приложение на Heroku , но, к сожалению, возникла другая ошибка:

Tungs-MBP:werewolf2 tungdo$ git push heroku master
Enumerating objects: 93, done.
Counting objects: 100% (93/93), done.
Delta compression using up to 8 threads
Compressing objects: 100% (90/90), done.
Writing objects: 100% (93/93), 25.70 KiB | 3.21 MiB/s, done.
Total 93 (delta 19), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:  !     Your Django version is nearing the end of its community support.
remote:  !     Upgrade to continue to receive security updates and for the best experience with Django.
remote:  !     For more information, check out https://www.djangoproject.com/download/#supported-versions
remote:        Collecting altgraph==0.10.2
remote:          Downloading altgraph-0.10.2.tar.gz (481 kB)
remote:        Collecting bdist-mpkg==0.5.0
remote:          Downloading bdist_mpkg-0.5.0.tar.gz (19 kB)
remote:        Collecting configparser==4.0.2
remote:          Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
remote:        Collecting contextlib2==0.6.0.post1
remote:          Downloading contextlib2-0.6.0.post1-py2.py3-none-any.whl (9.8 kB)
remote:        Collecting distlib==0.3.1
remote:          Downloading distlib-0.3.1-py2.py3-none-any.whl (335 kB)
remote:        Collecting Django==1.11.29
remote:          Downloading Django-1.11.29-py2.py3-none-any.whl (6.9 MB)
remote:        Collecting gunicorn==19.10.0
remote:          Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
remote:        Collecting macholib==1.5.1
remote:          Downloading macholib-1.5.1.tar.gz (454 kB)
remote:        Collecting modulegraph==0.10.4
remote:          Downloading modulegraph-0.10.4.tar.gz (532 kB)
remote:        Collecting py2app==0.7.3
remote:          Downloading py2app-0.7.3.tar.gz (1.2 MB)
remote:        Collecting pyOpenSSL==0.13.1
remote:          Downloading pyOpenSSL-0.13.1.tar.gz (254 kB)
remote:        Collecting pyparsing==2.0.1
remote:          Downloading pyparsing-2.0.1.tar.gz (1.1 MB)
remote:        Collecting python-dateutil==1.5
remote:          Downloading python-dateutil-1.5.tar.gz (233 kB)
remote:        Collecting pytz==2013.7
remote:          Downloading pytz-2013.7.tar.bz2 (177 kB)
remote:        Collecting six==1.4.1
remote:          Downloading six-1.4.1.tar.gz (21 kB)
remote:        Collecting xattr==0.9.7
remote:          Downloading xattr-0.9.7.tar.gz (13 kB)
remote:        Collecting zipp==1.2.0
remote:          Downloading zipp-1.2.0-py2.py3-none-any.whl (4.8 kB)
remote:        Collecting psycopg2==2.8.5
remote:          Downloading psycopg2-2.8.5.tar.gz (380 kB)
remote:        Collecting setuptools==1.0
remote:          Downloading setuptools-1.0.tar.gz (679 kB)
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gz436y7s/setuptools/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gz436y7s/setuptools/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-gz436y7s/setuptools/pip-egg-info
remote:                 cwd: /tmp/pip-install-gz436y7s/setuptools/
remote:            Complete output (15 lines):
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-install-gz436y7s/setuptools/setuptools/__init__.py", line 2, in <module>
remote:                from setuptools.extension import Extension, Library
remote:              File "/tmp/pip-install-gz436y7s/setuptools/setuptools/extension.py", line 5, in <module>
remote:                from setuptools.dist import _get_unpatched
remote:              File "/tmp/pip-install-gz436y7s/setuptools/setuptools/dist.py", line 8, in <module>
remote:                from setuptools.command.install import install
remote:              File "/tmp/pip-install-gz436y7s/setuptools/setuptools/command/__init__.py", line 8, in <module>
remote:                from setuptools.command import install_scripts
remote:              File "/tmp/pip-install-gz436y7s/setuptools/setuptools/command/install_scripts.py", line 3, in <module>
remote:                from pkg_resources import Distribution, PathMetadata, ensure_directory
remote:              File "/tmp/pip-install-gz436y7s/setuptools/pkg_resources.py", line 1435, in <module>
remote:                register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
remote:            AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to werewolf-boardgame.
remote: 
To https://git.heroku.com/werewolf-boardgame.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/werewolf-boardgame.git'

1 Ответ

0 голосов
/ 02 августа 2020

Похоже, вы включили библиотеки, которые могут работать только на MacOS, в частности, все ваши pyobjc-framework- зависимости в свой файл requirements.txt. Вот когда сценарий Heroku терпит неудачу. Он пытается установить эти библиотеки, но для этих библиотек требуется структура каталогов MacOS, и он терпит неудачу ( FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist').

...