【问题标题】:Command errored out with exit status 1:命令出错,退出状态为 1:
【发布时间】:2021-05-31 05:08:27
【问题描述】:

当我尝试在 heroku 上推送我的应用时遇到问题, 所以当我写 git push heroku master 时会出现这个错误

    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-48na90v5/importlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-48na90v5/importlib/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-pip-egg-info-dccx97n0       
    remote:                 cwd: /tmp/pip-install-48na90v5/importlib/
    remote:            Complete output (11 lines):
    remote:            Traceback (most recent call last):
    remote:              File "<string>", line 1, in <module>
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/__init__.py", line 5, in <module>
    remote:                import distutils.core
    remote:              File "/app/.heroku/python/lib/python3.6/distutils/core.py", line 16, in <module>
    remote:                from distutils.dist import Distribution
    remote:              File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 19, in <module>
    remote:                from distutils.util import check_environ, strtobool, rfc822_escape
    remote:              File "/app/.heroku/python/lib/python3.6/distutils/util.py", line 9, in <module>
    remote:                import importlib.util
    remote:            ModuleNotFoundError: No module named 'importlib.util'
    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

【问题讨论】:

    标签: python python-3.x django web heroku


    【解决方案1】:

    很可能是您尝试安装的库的问题,检查当前 heroku 使用最新版本的 python 的版本

    或者只是在你的根目录中使用 runtime.txt 文件来改变你在 Heroku 上项目的特定 python 版本

    我也遇到了完全相同的问题,我通过安装最新版本的依赖项解决了这个问题。

    尝试;肯定会成功的。

    【讨论】:

      猜你喜欢
      • 2021-10-29
      • 2020-03-07
      • 2020-03-05
      • 1970-01-01
      • 2020-07-08
      • 1970-01-01
      • 1970-01-01
      • 2020-03-12
      相关资源
      最近更新 更多