我正在尝试在Heroku上部署Python Flask app。当我拥有Pipfile时,我曾经部署得很好,但是Heroku的buildpack优先于pip安装requirements.txt
,所以我考虑删除Pipfile和Pipfile.lock,因为即使不使用虚拟环境也似乎更简单。这个项目。
但是,这在推送到存储库时引发了另一个问题:
mike@mike-thinks:~/Programing/Rasa/myflaskapp$ git push heroku master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 851 bytes | 0 bytes/s, done.
Total 9 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.6 (you are using python-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.6).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Uninstalling stale dependencies
remote: Uninstalling PySocks-1.6.8:
remote: Successfully uninstalled PySocks-1.6.8
remote: -----> Installing requirements with pip
remote: Collecting absl-py==0.2.2 (from -r /tmp/build_8e1104b68f6904d801f789290d219dd4/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/57/8d/6664518f9b6ced0aa41cf50b989740909261d4c212557400c48e5cda0804/absl-py-0.2.2.tar.gz (82kB)
remote: Collecting alabaster==0.7.10 (from -r /tmp/build_8e1104b68f6904d801f789290d219dd4/requirements.txt (line 2))
remote: Downloading https://files.pythonhosted.org/packages/2e/c3/9b7dcd8548cf2c00531763ba154e524af575e8f36701bacfe5bcadc67440/alabaster-0.7.10-py2.py3-none-any.whl
remote: Collecting apixu-client==0.0.1 (from -r /tmp/build_8e1104b68f6904d801f789290d219dd4/requirements.txt (line 3))
remote: Could not find a version that satisfies the requirement apixu-client==0.0.1 (from -r /tmp/build_8e1104b68f6904d801f789290d219dd4/requirements.txt (line 3)) (from versions: )
remote: No matching distribution found for apixu-client==0.0.1 (from -r /tmp/build_8e1104b68f6904d801f789290d219dd4/requirements.txt (line 3))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to rosenberg-moodbot.
remote:
To https://git.heroku.com/rosenberg-moodbot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/rosenberg-moodbot.git'
确实是在Pipfile
中指定的:
[[source]]
url = "https://pypi.python.org/simple"
[packages]
requests = { extras = ['socks'] }
[requires]
python_full_version = "3.6.5"
但是,即使在python-3.6.6
文件中写入requirements.txt
行,现在也会发生这种情况。
我应该退回Pipfile吗?