title: Error: class uri 'eventlet' invalid or not found
body: <p>I've been running a dockerized flask application that uses Celery to run tasks.
  To run the app I'm using gunicorn with eventlet and It's been working fine using alpine linux distribution.</p>
  
  <p>However I had to move to ubuntu due to some issues with sklearn and other libraries, and now I'm having problems to run my app.</p>
  
  <p>First of all I'm getting this error:</p>
  
  <pre><code>Error: class uri 'eventlet' invalid or not found:
  
  [Traceback (most recent call last):
    File "/myapp/env/lib/python3.6/site-packages/gunicorn/workers/geventlet.py", line 11, in &lt;module&gt;
      import eventlet
  ModuleNotFoundError: No module named 'eventlet'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/myapp/env/lib/python3.6/site-packages/gunicorn/util.py", line 135, in load_class
      mod = import_module('.'.join(components))
    File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "/myapp/env/lib/python3.6/site-packages/gunicorn/workers/geventlet.py", line 13, in &lt;module&gt;
      raise RuntimeError("You need eventlet installed to use this worker.")
  RuntimeError: You need eventlet installed to use this worker.
  </code></pre>
  
  <p>Then I tried by adding <code>pip install eventlet</code> to my app's Dockerfile, and now I have this another error:</p>
  
  <pre><code>Error: class uri 'eventlet' invalid or not found:
  
  [Traceback (most recent call last):
    File "/myapp/env/lib/python3.6/site-packages/gunicorn/util.py", line 135, in load_class
      mod = import_module('.'.join(components))
    File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "/myapp/env/lib/python3.6/site-packages/gunicorn/workers/geventlet.py", line 11, in &lt;module&gt;
      import eventlet
    File "/myapp/env/lib/python3.6/site-packages/eventlet/__init__.py", line 10, in &lt;module&gt;
      from eventlet import convenience
    File "/myapp/env/lib/python3.6/site-packages/eventlet/convenience.py", line 7, in &lt;module&gt;
      from eventlet.green import socket
    File "/myapp/env/lib/python3.6/site-packages/eventlet/green/socket.py", line 21, in &lt;module&gt;
      from eventlet.support import greendns
    File "/myapp/env/lib/python3.6/site-packages/eventlet/support/greendns.py", line 69, in &lt;module&gt;
      setattr(dns.rdtypes.IN, pkg, import_patched('dns.rdtypes.IN.' + pkg))
    File "/myapp/env/lib/python3.6/site-packages/eventlet/support/greendns.py", line 59, in import_patched
      return patcher.import_patched(module_name, **modules)
    File "/myapp/env/lib/python3.6/site-packages/eventlet/patcher.py", line 126, in import_patched
      *additional_modules + tuple(kw_additional_modules.items()))
    File "/myapp/env/lib/python3.6/site-packages/eventlet/patcher.py", line 100, in inject
      module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
    File "/myapp/env/lib/python3.6/site-packages/dns/rdtypes/IN/WKS.py", line 25, in &lt;module&gt;
      _proto_tcp = socket.getprotobyname('tcp')
  OSError: protocol not found
  </code></pre>
  
  <p>This is how I start my app (<code>start.sh</code>):</p>
  
  <p><code>gunicorn -w 1 --worker-class eventlet --certfile=myapp/myapp.crt --keyfile=myapp/myapp.key --bind 0.0.0.0:5000 --log-config myapp/gunicorn.conf myapp.run:app</code></p>
  
  <p>It's been working fine until I moved to an ubuntu based container.</p>
  
  <p>What am I missing here? </p>
  
  <p>I appreciate any help.</p>
  
  <p>Thanks!</p>