title: Problem launching docker-compose : python modules not installed
body: <p>I'm getting python error, trying to do a &quot;docker-compose up&quot; in the app folder.</p>
  <p>I get theses errors :</p>
  <pre><code>    Traceback (most recent call last):
    File &quot;/usr/lib/python3.8/site-packages/urllib3/connectionpool.py&quot;, line 670, in urlopen
      httplib_response = self._make_request(
    File &quot;/usr/lib/python3.8/site-packages/urllib3/connectionpool.py&quot;, line 392, in _make_request
      conn.request(method, url, **httplib_request_kw)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1255, in request
      self._send_request(method, url, body, headers, encode_chunked)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1301, in _send_request
      self.endheaders(body, encode_chunked=encode_chunked)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1250, in endheaders
      self._send_output(message_body, encode_chunked=encode_chunked)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1010, in _send_output
      self.send(msg)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 950, in send
      self.connect()
    File &quot;/usr/lib/python3.8/site-packages/docker/transport/unixconn.py&quot;, line 43, in connect
      sock.connect(self.unix_socket)
  FileNotFoundError: [Errno 2] No such file or directory
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.8/site-packages/requests/adapters.py&quot;, line 439, in send
      resp = conn.urlopen(
    File &quot;/usr/lib/python3.8/site-packages/urllib3/connectionpool.py&quot;, line 726, in urlopen
      retries = retries.increment(
    File &quot;/usr/lib/python3.8/site-packages/urllib3/util/retry.py&quot;, line 403, in increment
      raise six.reraise(type(error), error, _stacktrace)
    File &quot;/usr/lib/python3.8/site-packages/urllib3/packages/six.py&quot;, line 734, in reraise
      raise value.with_traceback(tb)
    File &quot;/usr/lib/python3.8/site-packages/urllib3/connectionpool.py&quot;, line 670, in urlopen
      httplib_response = self._make_request(
    File &quot;/usr/lib/python3.8/site-packages/urllib3/connectionpool.py&quot;, line 392, in _make_request
      conn.request(method, url, **httplib_request_kw)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1255, in request
      self._send_request(method, url, body, headers, encode_chunked)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1301, in _send_request
      self.endheaders(body, encode_chunked=encode_chunked)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1250, in endheaders
      self._send_output(message_body, encode_chunked=encode_chunked)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1010, in _send_output
      self.send(msg)
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 950, in send
      self.connect()
    File &quot;/usr/lib/python3.8/site-packages/docker/transport/unixconn.py&quot;, line 43, in connect
      sock.connect(self.unix_socket)
  urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.8/site-packages/docker/api/client.py&quot;, line 205, in _retrieve_server_version
      return self.version(api_version=False)[&quot;ApiVersion&quot;]
    File &quot;/usr/lib/python3.8/site-packages/docker/api/daemon.py&quot;, line 181, in version
      return self._result(self._get(url), json=True)
    File &quot;/usr/lib/python3.8/site-packages/docker/utils/decorators.py&quot;, line 46, in inner
      return f(self, *args, **kwargs)
    File &quot;/usr/lib/python3.8/site-packages/docker/api/client.py&quot;, line 228, in _get
      return self.get(url, **self._set_request_timeout(kwargs))
    File &quot;/usr/lib/python3.8/site-packages/requests/sessions.py&quot;, line 543, in get
      return self.request('GET', url, **kwargs)
    File &quot;/usr/lib/python3.8/site-packages/requests/sessions.py&quot;, line 530, in request
      resp = self.send(prep, **send_kwargs)
    File &quot;/usr/lib/python3.8/site-packages/requests/sessions.py&quot;, line 643, in send
      r = adapter.send(request, **kwargs)
    File &quot;/usr/lib/python3.8/site-packages/requests/adapters.py&quot;, line 498, in send
      raise ConnectionError(err, request=request)
  requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/usr/bin/docker-compose&quot;, line 33, in &lt;module&gt;
      sys.exit(load_entry_point('docker-compose==1.28.0.dev0', 'console_scripts', 'docker-compose')())
    File &quot;/usr/lib/python3.8/site-packages/compose/cli/main.py&quot;, line 67, in main
      command()
    File &quot;/usr/lib/python3.8/site-packages/compose/cli/main.py&quot;, line 123, in perform_command
      project = project_from_options('.', options)
    File &quot;/usr/lib/python3.8/site-packages/compose/cli/command.py&quot;, line 60, in project_from_options
      return get_project(
    File &quot;/usr/lib/python3.8/site-packages/compose/cli/command.py&quot;, line 131, in get_project
      client = get_client(
    File &quot;/usr/lib/python3.8/site-packages/compose/cli/docker_client.py&quot;, line 41, in get_client
      client = docker_client(
    File &quot;/usr/lib/python3.8/site-packages/compose/cli/docker_client.py&quot;, line 170, in docker_client
      client = APIClient(**kwargs)
    File &quot;/usr/lib/python3.8/site-packages/docker/api/client.py&quot;, line 188, in __init__
      self._version = self._retrieve_server_version()
    File &quot;/usr/lib/python3.8/site-packages/docker/api/client.py&quot;, line 212, in _retrieve_server_version
      raise DockerException(
  docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
  </code></pre>
  <p>Here is the Dockerfile :</p>
  <pre><code>FROM python:3
  ENV PYTHONBUFFERED=1
  RUN mkdir /code
  WORKDIR code
  COPY requirements.txt /code/
  RUN pip install -r requirements.txt
  COPY . /code/
  </code></pre>
  <p>The docker-compose.yml :</p>
  <pre><code>version: &quot;3.8&quot;
  
  services:
    db:
      image: sqlite
      environment:
        - SQLITE_DB=sqlite
        - SQLITE_USER=sqlite
        - SQLITE_PASSWORD=sqlite
    web:
      build: .
      command: python manage.py runserver 0.0.0.0:8000
      volumes:
        - .:/code
      ports:
        - &quot;8000:8000&quot;
      depends_on:
        - db
  </code></pre>
  <p>The requirements.txt :</p>
  <pre><code>Django&gt;=3.0,&lt;4.0
  psycopg2-binary&gt;=2.8
  </code></pre>
  <p>I'm new using docker. I try to dockerize an existing Django app. I'm not sure is the problem is due to docker-compose itself, or the command launched to install requirements.</p>
  <p>Thanks for your help !</p>