Ich versuche, die App, die sie erwähnt haben, im Abschnitt "Erste Schritte" bereitzustellen. Allerdings bekomme ich Fehler ModuleNotFoundError: No module named 'six'
. Das gesamte Erstellungsprotokoll ist unten erwähnt:Importfehler beim Bereitstellen der Django-App für Heroku
-----> Python app detected
-----> Installing python-3.6.1
-----> Installing pip
-----> Installing requirements with pip
Collecting dj-database-url==0.4.1 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 1))
Downloading dj-database-url-0.4.1.tar.gz
Collecting Django==1.9.7 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 2))
Downloading Django-1.9.7-py2.py3-none-any.whl (6.6MB)
Collecting gunicorn==19.6.0 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 3))
Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
Collecting psycopg2==2.6.2 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 4))
Downloading psycopg2-2.6.2.tar.gz (376kB)
Collecting whitenoise==2.0.6 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 5))
Downloading whitenoise-2.0.6-py2.py3-none-any.whl
Installing collected packages: dj-database-url, Django, gunicorn, psycopg2, whitenoise
Running setup.py install for dj-database-url: started
Running setup.py install for dj-database-url: finished with status 'error'
Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vkji1x5w/dj-database-url/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-e09119wj-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying dj_database_url.py -> build/lib
running egg_info
writing dj_database_url.egg-info/PKG-INFO
writing dependency_links to dj_database_url.egg-info/dependency_links.txt
writing top-level names to dj_database_url.egg-info/top_level.txt
reading manifest file 'dj_database_url.egg-info/SOURCES.txt'
writing manifest file 'dj_database_url.egg-info/SOURCES.txt'
running install_lib
copying build/lib/dj_database_url.py -> /app/.heroku/python/lib/python3.6/site-packages
byte-compiling /app/.heroku/python/lib/python3.6/site-packages/dj_database_url.py to dj_database_url.cpython-36.pyc
running install_egg_info
Copying dj_database_url.egg-info to /app/.heroku/python/lib/python3.6/site-packages/dj_database_url-0.4.1-py3.6.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vkji1x5w/dj-database-url/setup.py", line 89, in <module>
'Programming Language :: Python :: 3.5',
File "/app/.heroku/python/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/app/.heroku/python/lib/python3.6/distutils/command/install.py", line 557, in run
self.run_command(cmd_name)
File "/app/.heroku/python/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 49, in <module>
from setuptools.py27compat import rmtree_safe
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/py27compat.py", line 7, in <module>
import six
ModuleNotFoundError: No module named 'six'
----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vkji1x5w/dj-database-url/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-e09119wj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vkji1x5w/dj-database-url/
! Push rejected, failed to compile Python app.
! Push failed
Ich habe sogar das six
Modul installiert, aber es funktioniert nicht.
Es sieht so aus, als ob Sie [dieses Problem] (https://github.com/pypa/setuptools/issues/1042) in setuptools treffen. – Alasdair
können Sie versuchen, "sechs" an der Spitze der Anforderungen.txt-Datei –
Ich habe das versucht, aber es installiert es nicht und direkt in die zweite Abhängigkeit verschieben. –