【发布时间】:2021-12-16 16:15:05
【问题描述】:
我之前已经成功部署过这个项目很多次,但是没有对项目根目录下的 requirements.txt 文件进行任何更改。
Heroku 将不再接受引用依赖问题的相同 requirements.txt 文件
Heroku 仍会打开最后一个有效部署以允许我“”heroku run “pip freeze”
部署的heroku requirements.txt
appnope==0.1.2
asgiref==3.4.1
backcall==0.2.0
backports.entry-points-selectable==1.1.0
blis==0.7.4
catalogue==2.0.6
certifi==2021.5.30
charset-normalizer==2.0.4
ChatterBot==1.0.4
chatterbot-corpus==1.2.0
click==8.0.1
colorgram.py==1.2.0
cymem==2.0.5
debugpy==1.4.3
decorator==5.1.0
distlib==0.3.3
dj-database-url==0.5.0
Django==3.2.8
django-filter==2.4.0
django-heroku==0.0.0
django-simple-chatbot==0.0.9
django-widget-tweaks==1.4.8
djangorestframework==3.12.4
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.1.0/en_core_web_sm-3.1.0-py3-none-any.whl
entrypoints==0.3
filelock==3.3.0
future==0.18.2
greenlet==1.1.2
gunicorn==20.1.0
heroku==0.1.4
httpie==2.4.0
huggingface-hub==0.0.12
idna==3.2
ipykernel==6.4.1
ipython==7.28.0
ipython-genutils==0.2.0
jedi==0.18.0
Jinja2==3.0.1
joblib==1.0.1
jupyter-client==7.0.3
jupyter-core==4.8.1
line-bot-sdk==1.20.0
MarkupSafe==2.0.1
mathparse==0.1.2
matplotlib-inline==0.1.3
murmurhash==1.0.5
nest-asyncio==1.5.1
nltk==3.6.2
numpy==1.21.2
packaging==21.0
parso==0.8.2
pathy==0.6.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.3.2
Pint==0.17
pipenv==2021.5.29
platformdirs==2.4.0
preshed==3.0.5
print==1.3.0
prompt-toolkit==3.0.20
psycopg==3.0b1
psycopg2==2.9.1
psycopg2-binary==2.9.1
ptyprocess==0.7.0
pydantic==1.8.2
Pygments==2.10.0
pymongo==3.12.0
pyparsing==2.4.7
PySocks==1.7.1
python-dateutil==2.7.5
pytz==2021.3
PyYAML==5.4.1
pyzmq==22.3.0
regex==2021.8.28
requests==2.26.0
requests-toolbelt==0.9.1
sacremoses==0.0.46
six==1.16.0
smart-open==5.2.1
spacy==3.1.3
spacy-alignments==0.8.3
spacy-legacy==3.0.8
spacy-transformers==1.0.6
SQLAlchemy==1.2.19
sqlparse==0.4.2
srsly==2.4.1
textblob==0.15.3
thinc==8.0.10
tokenizers==0.10.3
torch==1.8.1+cpu
torchvision==0.9.1+cpu
tornado==6.1
tqdm==4.62.2
traitlets==5.1.0
transformers==4.9.2
turtle==0.0.1
typer==0.4.0
typing-extensions==3.10.0.2
urllib3==1.26.6
virtualenv==20.8.1
virtualenv-clone==0.5.7
wasabi==0.8.2
当我尝试使用相同的 requirements.txt 文件部署我的最新版本时,heroku 现在告诉我以下错误。
The conflict is caused by:
The user requested PyYAML==5.4.1
chatterbot-corpus 1.2.0 depends on PyYAML<4.0 and >=3.12
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
! Push rejected, failed to compile Python app.
! Push failed
放松版本或完全删除它们并不能解决问题。
有没有办法我可以使用类似的东西来部署应用程序
-r requirements.txt -no dependencies
因为我最近一直在使用和更新(通过 GitHub 推送)该应用程序而没有问题,所以我试图解决这个问题的根源。
我检查了 GitHub 推送文档,回滚了对我的应用所做的唯一更改,但仍然存在依赖项错误。
heroku 是否为我清除了缓存或更新了依赖项的使用方式?我完全进退两难了。
提前感谢您提供的任何见解。
【问题讨论】:
-
有什么原因不能使用 PyYAML
-
谢谢。有多个依赖问题,所以当我放松时,其他人展示了自己,python-time-and-date 影响了一切。经过一些实验和很多失败。在 Heroku(python 3.7)中删除所有非必要的依赖项并使用不同的运行时版本的 python 解决了我的问题,足以缓解剩余的兼容性问题。此外,pip 最近在 Heroku 上进行了更新,这也是加强兼容性验证的原因。
标签: django heroku pip pyyaml chatterbot