2017-10-12 2 views
2

ich diesen Fehler bin vor, wenn ich ‚Kanäle‘ in INSTALLED_APPS hinzufügenPush-to-Heroku: kein Modul mit dem Namen ‚Kanäle‘

Writing objects: 100% (4/4), 351 bytes | 0 bytes/s, done. 
Total 4 (delta 3), reused 0 (delta 0) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Python app detected 
remote: -----> Installing requirements with latest Pipenv… 
remote:  Installing dependencies from Pipfile.lock (36121f)… 
remote: -----> $ python manage.py collectstatic --noinput 
remote:  Traceback (most recent call last): 
remote:   File "manage.py", line 10, in <module> 
remote:   execute_from_command_line(sys.argv) 
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line 
remote:   utility.execute() 
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute 
remote:   django.setup() 
remote:   File "/app/.heroku/python/lib/python3.6/site- packages/django/__init__.py", line 27, in setup 
remote:   apps.populate(settings.INSTALLED_APPS) 
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate 
remote:   app_config = AppConfig.create(entry) 
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 94, in create 
remote:   module = import_module(entry) 
remote:   File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module 
remote:   return _bootstrap._gcd_import(name[level:], package, level) 
remote:   File "<frozen importlib._bootstrap>", line 978, in _gcd_import 
remote:   File "<frozen importlib._bootstrap>", line 961, in _find_and_load 
remote:   File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked 
remote:  ModuleNotFoundError: No module named 'channels' 
remote: 
remote: !  Error while running '$ python manage.py collectstatic --noinput'. 
remote:  See traceback above for details. 
remote: 
remote:  You may need to update application code to resolve this error. 
remote:  Or, you can disable collectstatic for this application: 
remote: 
remote:   $ heroku config:set DISABLE_COLLECTSTATIC=1 
remote: 
remote:  https://devcenter.heroku.com/articles/django-assets 
remote: !  Push rejected, failed to compile Python app. 
remote: 
remote: !  Push failed  

Was habe ich bisher versucht:

ich die collectstatic deaktivieren und ist in der Lage, den Code zu Heroku schieben, aber Server

deinstallation die Kanäle und installieren wieder

einige Tipps jemand mir, danke abgestürzt ist.

+0

Ist es in Ihrem requirements.txt? Zeige diese Datei. –

+0

Ich fand es in der requirement.txt, Liste wie folgt asgi-redisis == 1.4.3 asgiref == 1.1.2 astroid == 1.5.3 attrs == 17.2.0 Autobahn == 17.9.3 Automat == 0.6.0 Zertifi == 2017.7.27.1 Kanäle == 1.1.8 chardet == 3.0.4 colorama == 0.3.9 ständig == 15.1.0 Seidelbast == 1.3.0 Dekorateur == 4.1.2 dj-Datenbank-uRL == 0.4.2 Django == 1.11.6 flake8 == 3.4.1 Hyperlink == 17.3.1 IDNA == 2.6 inkrementalen == == 17.5.0 ipython 6.2.1 ipython-genutils == 0.2.0 iSort == 4.2.15 jedi == 0.11.0 lazy-Objekt-proxy == 1.3.1 – Kaspar

+0

Entschuldigung für das unklare Format .... siehe unten ! [Valid XHTML] (https://imgur.com/a/kbHIO). – Kaspar

Antwort

1

Ich hatte das gleiche Problem. Das Problem war aufgrund der Tatsache, dass ich django-Kanäle verwendet (es gibt auch django_channels) anstelle von Kanäle. Das richtige Paket für Django-Kanäle ist in der Tat Kanäle.

So einfach dies tun:

  1. Liste alle installierten Pakete mit Kanäle dort Namen

pip Liste | grep Kanäle

output:

Kanäle (1.1.6)

Kanäle-api (0.4.0)

django-Kanäle (0.7.0)

  1. Deinstallieren Sie jede von ihnen (gerade Kanäle) mit pip uninstall package-name: ex: pip uninstall django-Kanäle
  2. Installieren Sie nur die Kanäle (Hexe Kanäle genannt wird nicht 'django-Kanäle' oder 'django_channels') Paket mit:

pip Kanäle installieren

  1. erstellen requirements.txt mit:

pip freeze> requirements.txt

+0

danke für die Antwort, es gibt kein anderes Paket beziehen sich auf die Kanäle .. Ich folgte der Gildenanfang von heroku und noch kein anderes Paket installieren. also bin ich wirklich verwirrt was passiert ist ... – Kaspar

Verwandte Themen