title: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/django_redis_cache-3.0.0-py3.6.egg'
body: <p>While docker image was being created, I've got the below exception:</p>
  <pre><code>FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/django_redis_cache-3.0.0-py3.6.egg'
  </code></pre>
  <p><strong>Dockerfile:</strong></p>
  <pre><code>FROM python:3.6
  
  # ...
  </code></pre>
  <p><strong>Packages:</strong></p>
  <pre><code>django==2.0.6
  redis==3.5.3
  django-redis-cache==2.0.0
  django-redis-sessions
  </code></pre>
  <p>Here is a full trace of the exception:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/usr/local/bin/pip&quot;, line 8, in &lt;module&gt;
      sys.exit(main())
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/cli/main.py&quot;, line 75, in main
      return command.main(cmd_args)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py&quot;, line 121, in main
      return self._main(args)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py&quot;, line 265, in _main
      self.handle_pip_version_check(options)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py&quot;, line 152, in handle_pip_version_check
      timeout=min(5, options.timeout)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py&quot;, line 97, in _build_session
      index_urls=self._get_index_urls(options),
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/network/session.py&quot;, line 249, in __init__
      self.headers[&quot;User-Agent&quot;] = user_agent()
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/network/session.py&quot;, line 159, in user_agent
      setuptools_version = get_installed_version(&quot;setuptools&quot;)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_internal/utils/misc.py&quot;, line 665, in get_installed_version
      working_set = pkg_resources.WorkingSet()
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 567, in __init__
      self.add_entry(entry)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 623, in add_entry
      for dist in find_distributions(entry, True):
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 1983, in find_eggs_in_zip
      if metadata.has_metadata('PKG-INFO'):
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 1414, in has_metadata
      return self._has(path)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 1854, in _has
      return zip_path in self.zipinfo or zip_path in self._index()
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 1731, in zipinfo
      return self._zip_manifests.load(self.loader.archive)
    File &quot;/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py&quot;, line 1688, in load
      mtime = os.stat(path).st_mtime
  FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/django_redis_cache-3.0.0-py3.6.egg'
  </code></pre>
  <p><strong>Question:</strong></p>
  <p>How can I overcome this issue? Any help would be appreciated!</p>