gpt4 book ai didi

python - Heroku 设置 pip 失败

转载 作者:太空狗 更新时间:2023-10-30 03:02:08 24 4
gpt4 key购买 nike

我正在尝试将 django 应用程序部署到 Heroku,它依赖于 django-admin-tools,正如您在上面的 requirements.txt 中看到的

当我运行 push 命令时,Heroku 无法安装包,但我在 pypi 中看到了它

https://pypi.python.org/pypi/django-admin-tools

有什么帮助吗?

requirements.txt

MySQL-python==1.2.3
Django==1.6.2
simple-db-migrate==2.0.0
django-debug-toolbar==1.0.1
django-admin-tools==0.5.1
dj-database-url==0.2.2
dj-static==0.0.5
static==0.4

推送

    git push heroku master







Fetching repository, done.
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 623 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)

-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.6.
-----> Using Python runtime (python-2.7.6)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking django-admin-tools==0.5.1 (from -r requirements.txt (line 7))
http://bitbucket.org/izi/django-admin-tools/0.5.1 uses an insecure transport scheme (http). Consider using https if bitbucket.org has it available
http://bitbucket.org/izi/django-admin-tools/ uses an insecure transport scheme (http). Consider using https if bitbucket.org has it available
Could not find any downloads that satisfy the requirement django-admin-tools==0.5.1 (from -r requirements.txt (line 7))
Cleaning up...
No distributions at all found for django-admin-tools==0.5.1 (from -r requirements.txt (line 7))
Storing debug log for failure in /app/.pip/pip.log

! Push rejected, failed to compile Python app

如果我在我的机器上运行 pip install django-admin-tools==0.5.1 它可以工作,但是当我尝试推送到 Heroku 时它一直显示错误

最佳答案

可能您在本地计算机上使用的是旧版本的 pip,而 Heroku 使用的是新版本的 pip。

django-admin-tools==0.5.1 托管在 bitbucket 上。默认情况下,不再允许 pip 安装未托管在 PyPI 本身上的包。所以安装失败。

将以下内容添加到您的 requirements.txt 中即可解决问题。

--allow-unverified django-admin-tools
django-admin-tools==0.5.1

引用资料:

Forced use of --allow-external and --allow-unverified very inconvenient and not very intuitive #1423

关于python - Heroku 设置 pip 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22977268/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com