【发布时间】:2020-06-14 04:41:45
【问题描述】:
我正在尝试将 heroku 用于带有 Python 的电报机器人。
一切都很好,只是我无法安装 MetaTrader5 模块。
当我输入git push heroku master 命令时,PowerShell 中的答案是:
Enumerating objects: 59, done.
Counting objects: 100% (59/59), done.
Delta compression using up to 4 threads
Compressing objects: 100% (50/50), done.
Writing objects: 100% (59/59), 417.63 KiB | 5.42 MiB/s, done.
Total 59 (delta 19), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.6
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote: Collecting certifi==2019.11.28
remote: Downloading certifi-2019.11.28-py2.py3-none-any.whl (156 kB)
remote: Collecting chardet==3.0.4
remote: Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
remote: Collecting idna==2.9
remote: Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
remote: Collecting int-date==0.1.8
remote: Downloading int_date-0.1.8-py2.py3-none-any.whl (5.0 kB)
remote: ERROR: Could not find a version that satisfies the requirement MetaTrader5==5.0.24 (from -r /tmp/build_4e6218f160af939bdbff3e12742a3458/requirements.txt (line 5)) (from versions: none)
remote: ERROR: No matching distribution found for MetaTrader5==5.0.24 (from -r /tmp/build_4e6218f160af939bdbff3e12742a3458/requirements.txt (line 5))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to telegram-bot-2567.
remote:
To https://git.heroku.com/telegram-bot-2567.git
! [remote rejected] master -> master (pre-receive hook declined)
在我的需求文本中,我有MetaTrader5==5.0.24。
我已经在我自己的 PC 上使用了这个模块,但我不能在 heroku 上使用它。
有什么解决办法吗?
【问题讨论】:
-
编辑您的 requirements.txt 并从
MetaTrader5==5.0.24中删除MetaTrader5。 (这只是暂时的,看看它是否会安装它。)还要检查您在本地使用的 Python 版本 (python -V) 并将 Heroku 的 (Python 3.7.6) 与您的本地版本匹配(假设 Heroku 仍然支持该 Python)。 -
我的python版本是3.7.6,我认为heroku支持它,除了metatrader之外的所有其他模块都安装了,我在没有那个==version的情况下尝试过,但错误仍然相同。不知道为什么安装不了metatrader,正在寻找解决办法
标签: python heroku telegram metatrader5