Je suis en train de migrer un projet vers python sur docker pour une meilleure "facilité" de développement. Ut est un projet qui fonctionne avec python 2.7, Django 1.6.8 et plusieurs dépendances RPC.
Je me retrouve avec un crash de l'application avec cette stacktrace que je n'arrive pas à trouver le module manquant (Aucun module nommé coros) .
Je pense que cela doit être soit un problème de dépendance lié à une version qui n'est pas bonne, soit une dépendance installée sur l'os par défaut mais pas sur l'os docker. Avez-vous des idées ou des suggestions pour corriger ce problème ?
Mon Dockerfile
FROM python:2
WORKDIR /var/www
RUN echo "deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/ ./" >> /etc/apt/sources.list
RUN wget https://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/Release.key -O- | apt-key add
RUN apt-get update
RUN apt-get install libzmq3-dev libev-dev -y
RUN apt-get install -y bash \
git \
default-libmysqlclient-dev \
libldap2-dev \
libsasl2-dev \
libssl-dev \
python-gevent \
python-gevent-websocket \
build-essential \
python-dev \
locales
RUN pip install django-debug-toolbar==1.2.1
RUN apt-get install libevent-dev -y
RUN apt-get install python-all-dev -y
RUN pip install gevent
RUN pip install greenlet
RUN pip install --upgrade pip
ADD requirements.txt ./
RUN pip install -r requirements.txt
RUN pip install pyzmq
Mon fichier d'exigences
crispy-forms-foundation==0.2.3.1
django-crispy-forms==1.3.2
Django==1.6.8
django-auth-ldap==1.1.4
django-pipeline==1.3.14
iso8601==0.1.8
MySQL-python==1.2.5
nameko==2.1.2
python-ldap==2.4.10
python-memcached==1.53
pytz==2013.8
django-widget-tweaks==1.3
Babel==1.3
django-braces==1.2.2
PyReact==0.2.0
raven==3.2.1
djangorestframework==3.1.3
django-statsd-mozilla==0.3.12
boto==2.8.0
libthumbor==1.0.1
Pillow==2.5.1
django-debug-toolbar==1.2.2
South==1.0.1
zerorpc==0.4.4
requests>=2.7.0,<3.0.0
python-updict==0.1.2
graphene==0.10.2
beautifulsoup4==4.5.1
ciso8601==1.0.2
Trace d'erreur
app_1 | Traceback (most recent call last):
app_1 | File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 85, in run
app_1 | self.result = application(self.environ, self.start_response)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
app_1 | return self.application(environ, start_response)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
app_1 | self.load_middleware()
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 45, in load_middleware
app_1 | mw_class = import_by_path(middleware_path)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/utils/module_loading.py", line 26, in import_by_path
app_1 | sys.exc_info()[2])
app_1 | File "/usr/local/lib/python2.7/site-packages/django/utils/module_loading.py", line 21, in import_by_path
app_1 | module = import_module(module_path)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
app_1 | __import__(name)
app_1 | File "/var/www/ofsdashboards/common/middleware/login_required.py", line 7, in <module>
app_1 | compile(reverse('ofsdashboards.account.views.login').lstrip('/')),
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 536, in reverse
app_1 | return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 403, in _reverse_with_prefix
app_1 | self._populate()
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 267, in _populate
app_1 | for pattern in reversed(self.url_patterns):
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 365, in url_patterns
app_1 | patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 360, in urlconf_module
app_1 | self._urlconf_module = import_module(self.urlconf_name)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
app_1 | __import__(name)
app_1 | File "/var/www/ofsdashboards/urls.py", line 33, in <module>
app_1 | url(r'^homes/', include('ofsdashboards.homes.urls')),
app_1 | File "/usr/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 26, in include
app_1 | urlconf_module = import_module(urlconf_module)
app_1 | File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
app_1 | __import__(name)
app_1 | File "/var/www/ofsdashboards/homes/urls.py", line 5, in <module>
app_1 | from .dashboard import views as dashboard_views
app_1 | File "/var/www/ofsdashboards/homes/dashboard/views.py", line 17, in <module>
app_1 | from ofsdashboards.common.react_renderer import render
app_1 | File "/var/www/ofsdashboards/common/react_renderer.py", line 2, in <module>
app_1 | import zerorpc
app_1 | File "/usr/local/lib/python2.7/site-packages/zerorpc/__init__.py", line 28, in <module>
app_1 | from .socket import *
app_1 | File "/usr/local/lib/python2.7/site-packages/zerorpc/socket.py", line 27, in <module>
app_1 | from .events import Events
app_1 | File "/usr/local/lib/python2.7/site-packages/zerorpc/events.py", line 31, in <module>
app_1 | import gevent.coros
app_1 | ImproperlyConfigured: Error importing module ofsdashboards.common.middleware.login_required: "No module named coros"