【问题标题】:Django Web App Heroku Deployement : No matching distribution found for decouple==0.0.7Django Web App Heroku Deployement:没有为 decouple==0.0.7 找到匹配的分布
【发布时间】:2020-01-26 06:09:26
【问题描述】:

我正在 Heroku 上部署一个用 Django 制作的网络应用程序。 我正在关注一个教程,其中导师制作了一个 w/s,没有来自用户的任何 CSS/图像输入。但是我的应用程序有很多样式和个人资料图片等需要在模型中使用 ImageField。

IMP -> 我为 Django 2.2 制作了项目,但 django 3 已经启动,所以我正在使用它。

请帮帮我...

我已经完成了以下步骤:

  1. 已安装 Anaconda
  2. 制作虚拟环境并激活它。
  3. 安装的点子
  4. 已安装的依赖项
  5. 点冻结> requirements.txt
  6. git 添加。 & git push -am "文本"
  7. git push heroku master

我的要求.txt:

asgiref==3.2.3
certifi==2019.11.28
cffi==1.13.2
decouple==0.0.7
dj-database-url==0.5.0
Django==3.0.2
django-appconf==1.0.3
django-bootstrap3==12.0.3
django-heroku==0.3.1
django-mediumeditor==1.0.0
gunicorn==20.0.4
misaka==2.1.1
psycopg2==2.8.4
pycparser==2.19
python-decouple==3.3
pytz==2019.3
six==1.14.0
sqlparse==0.3.0
whitenoise==5.0.1

我的错误:

Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 8 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 1.96 KiB | 1.96 MiB/s, done.
Total 16 (delta 9), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Need to update SQLite3, clearing cache
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote:        Collecting asgiref==3.2.3 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/a5/cb/5a235b605a9753ebcb2730c75e610fb51c8cab3f01230080a8229fa36adb/asgiref-3.2.3-py2.py3-none-any.whl
remote:        Collecting certifi==2019.11.28 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
remote:        Collecting cffi==1.13.2 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/49/72/0d42f94fe94afa8030350c26e9d787219f3f008ec9bf6b86c66532b29236/cffi-1.13.2-cp36-cp36m-manylinux1_x86_64.whl (397kB)
remote:        Collecting decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4))
remote:          Could not find a version that satisfies the requirement decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4)) (from versions: )
remote:        No matching distribution found for decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to *******.
remote: 
To https://git.heroku.com/******.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/******.git'

【问题讨论】:

    标签: python django git heroku


    【解决方案1】:

    您需要在项目的根目录中添加一个 runtime.txt 文件,其中包含以下内容: python-3.7.2

    然后再推。

    【讨论】:

      【解决方案2】:

      你使用 Python 3.6,decouplerequiresPython 3.7+。

      【讨论】:

        猜你喜欢
        • 2016-05-13
        • 2017-11-24
        • 2019-09-04
        • 2017-11-14
        • 1970-01-01
        • 2016-06-06
        • 2019-07-31
        • 2021-09-22
        • 2017-05-07
        相关资源
        最近更新 更多