Django在Heroku上:没有名为“ future”的模块

我的英语不好,如果不能很好地提出问题,我感到抱歉。
我在Heroku上部署Django应用时遇到问题。

我执行了git push heroku master命令。

结果如下,

Enumerating objects: 1020,done.
Counting objects: 100% (1020/1020),done.
Delta compression using up to 8 threads
Compressing objects: 100% (1002/1002),done.
Writing objects: 100% (1020/1020),3.24 MiB | 164.00 KiB/s,done.
Total 1020 (delta 92),reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.5
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting ansicolors==1.1.8 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/53/18/a56e2fe47b259bb52201093a3a9d4a32014f9d85071ad07e9d60600890ca/ansicolors-1.1.8-py2.py3-none-any.whl
remote:        Collecting cachetools==3.1.1 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/2f/a6/30b0a0bef12283e83e58c1d6e7b5aabc7acfc4110df81a4471655d33e704/cachetools-3.1.1-py2.py3-none-any.whl
remote:        Collecting certifi==2019.9.11 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
remote:        Collecting chardet==3.0.4 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 4))
remote:          Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote:        Collecting cycler==0.10.0 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 5))
remote:          Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
remote:        Collecting decorator==4.4.1 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 6))
remote:          Downloading https://files.pythonhosted.org/packages/8f/b7/f329cfdc75f3d28d12c65980e4469e2fa373f1953f5df6e370e84ea2e875/decorator-4.4.1-py2.py3-none-any.whl
remote:        Collecting dj-database-url==0.5.0 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 7))
remote:          Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl
remote:        Collecting Django==2.2.7 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 8))
remote:          Downloading https://files.pythonhosted.org/packages/a0/36/463632a2e9161a7e713488d719a280e8cb0c7e3a66ed32a32e801891caae/Django-2.2.7-py3-none-any.whl (7.5MB)
remote:        Collecting django-heroku==0.3.1 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 9))
remote:          Downloading https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl
remote:        Collecting ez-setup==0.9 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 10))
remote:          Downloading https://files.pythonhosted.org/packages/ba/2c/743df41bd6b3298706dfe91b0c7ecdc47f2dc1a3104abeb6e9aa4a45fa5d/ez_setup-0.9.tar.gz
remote:        Collecting FiPy==3.3 (from -r /tmp/build_365f03de11037b944e5a8b3a3b35c4c5/requirements.txt (line 11))
remote:          Downloading https://files.pythonhosted.org/packages/d5/44/71e621c7b06e3ef4f19b8e064d729b6f7378ae3c9a1ecaf66f0ad16e0cea/FiPy-3.3.tar.gz (714kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>",line 1,in <module>
remote:              File "/tmp/pip-build-3spi5hu3/FiPy/setup.py",line 15,in <module>
remote:                from _setup.build_docs import build_docs
remote:              File "/tmp/pip-build-3spi5hu3/FiPy/_setup/build_docs.py",line 4,in <module>
remote:                from future.utils import text_to_native_str
remote:            ModuleNotFoundError: No module named 'future'
remote:
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3spi5hu3/FiPy/
remote:  !     Push rejected,failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to test-app0011.
remote:
To https://git.heroku.com/test-app0011.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test-app0011.git'

我尝试手动安装(使用以下命令)。

sudo pip install future

结果如下,

  

已经满足要求:/Users/shinya/.pyenv/versions/3.7.5/lib/python3.7/site-packages(0.18.2)中的将来

执行“ git add。git commit”后,错误内容已更改。 错误详细信息如下,

Enumerating objects: 1023,done.
Counting objects: 100% (1023/1023),done.
Delta compression using up to 8 threads
Compressing objects: 100% (1004/1004),done.
Writing objects: 100% (1023/1023),3.24 MiB | 107.00 KiB/s,done.
Total 1023 (delta 93),reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     Requested runtime (python-3.7.3 python-3.7.5) is not available for this stack (heroku-18).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected,failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to test-app0011.
remote:
To https://git.heroku.com/test-app0011.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test-app0011.git'

以下是requirements.txt的内容。

ansicolors==1.1.8
cachetools==3.1.1
certifi==2019.9.11
chardet==3.0.4
cycler==0.10.0
decorator==4.4.1
dj-database-url==0.5.0
Django==2.2.7
django-heroku==0.3.1
ez-setup==0.9
FiPy==3.3
future==0.18.2
gitdb2==2.0.6
GitPython==3.0.5
gunicorn==20.0.0
idna==2.8
imageio==2.6.1
imageio-ffmpeg==0.3.0
joblib==0.14.0
kiwisolver==1.1.0
matplotlib==3.1.2
moviepy==1.0.1
music21==5.7.1
numpy==1.17.3
pbr==5.4.3
Pillow==6.2.1
proglog==0.1.9
psycopg2==2.8.4
pyparsing==2.4.5
python-dateutil==2.8.1
pytz==2019.3
reppy==0.4.14
requests==2.22.0
scikit-learn==0.21.3
scipy==1.3.1
six==1.13.0
smmap2==2.0.5
sqlparse==0.3.0
stevedore==1.31.0
tqdm==4.38.0
unroll==0.1.0
urllib3==1.25.7
virtualenv==16.7.7
virtualenv-clone==0.5.3
virtualenvwrapper==4.8.4
whitenoise==4.1.4


cat runtime.txt 结果如下

python-3.7.3 python-3.7.5

由于在runtime.txt中列出了两个版本,所以我只列出了“ python 3.7.5”,这是“ python -V”的执行结果。

和“冻结点子> requirements.txt” 被执行,“ git push heroku master”被执行。 结果如下。

Enumerating objects: 1031,done.
Counting objects: 100% (1031/1031),done.
Delta compression using up to 8 threads
Compressing objects: 100% (1011/1011),done.
Writing objects: 100% (1031/1031),3.24 MiB | 171.00 KiB/s,done.
Total 1031 (delta 98),reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.5
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting ansicolors==1.1.8 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/53/18/a56e2fe47b259bb52201093a3a9d4a32014f9d85071ad07e9d60600890ca/ansicolors-1.1.8-py2.py3-none-any.whl
remote:        Collecting cachetools==3.1.1 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/2f/a6/30b0a0bef12283e83e58c1d6e7b5aabc7acfc4110df81a4471655d33e704/cachetools-3.1.1-py2.py3-none-any.whl
remote:        Collecting certifi==2019.9.11 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
remote:        Collecting chardet==3.0.4 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 4))
remote:          Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote:        Collecting cycler==0.10.0 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 5))
remote:          Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
remote:        Collecting decorator==4.4.1 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 6))
remote:          Downloading https://files.pythonhosted.org/packages/8f/b7/f329cfdc75f3d28d12c65980e4469e2fa373f1953f5df6e370e84ea2e875/decorator-4.4.1-py2.py3-none-any.whl
remote:        Collecting dj-database-url==0.5.0 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 7))
remote:          Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl
remote:        Collecting Django==2.2.7 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 8))
remote:          Downloading https://files.pythonhosted.org/packages/a0/36/463632a2e9161a7e713488d719a280e8cb0c7e3a66ed32a32e801891caae/Django-2.2.7-py3-none-any.whl (7.5MB)
remote:        Collecting django-heroku==0.3.1 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 9))
remote:          Downloading https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl
remote:        Collecting ez-setup==0.9 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 10))
remote:          Downloading https://files.pythonhosted.org/packages/ba/2c/743df41bd6b3298706dfe91b0c7ecdc47f2dc1a3104abeb6e9aa4a45fa5d/ez_setup-0.9.tar.gz
remote:        Collecting FiPy==3.3 (from -r /tmp/build_d531ba8e8c3f16ef800647d83fcdd7dc/requirements.txt (line 11))
remote:          Downloading https://files.pythonhosted.org/packages/d5/44/71e621c7b06e3ef4f19b8e064d729b6f7378ae3c9a1ecaf66f0ad16e0cea/FiPy-3.3.tar.gz (714kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>",in <module>
remote:              File "/tmp/pip-build-p_3htk4o/FiPy/setup.py",in <module>
remote:                from _setup.build_docs import build_docs
remote:              File "/tmp/pip-build-p_3htk4o/FiPy/_setup/build_docs.py",in <module>
remote:                from future.utils import text_to_native_str
remote:            ModuleNotFoundError: No module named 'future'
remote:
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-p_3htk4o/FiPy/
remote:  !     Push rejected,failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to test-app0011.
remote:
To https://git.heroku.com/test-app0011.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test-app0011.git'
delete0012005 回答:Django在Heroku上:没有名为“ future”的模块

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3042456.html

大家都在问