title: pip install error: package directory does not exist
body: <p>I've looked at similar questions, but with no luck of answer, I have the following structure</p>
  
  <pre><code>├── README.rst
  ├── setup.py
  └── my_package
      ├── conf.py
      ├── sub_module1
      │   └── __init__.py
      │   └── some_code.py
      ├── sub_module2
      │   └── __init__.py
      │   └── some_other_code.py
      ├── some_main_code.py
      └── __init__.py
  </code></pre>
  
  <p>And my <code>setup.py</code> looks something like</p>
  
  <pre><code>..
  setup(name=..
        ...
        packages=find_packages('my_package')
  </code></pre>
  
  <p>When installing I get the following error</p>
  
  <pre><code>    ERROR: Command errored out with exit status 1:
       command: /some_path/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f7hcw6xa/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f7hcw6xa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-f7hcw6xa/pip-egg-info
           cwd: /tmp/pip-req-build-f7hcw6xa/
      Complete output (8 lines):
      running egg_info
      creating /tmp/pip-req-build-f7hcw6xa/pip-egg-info/my_package.egg-info
      writing /tmp/pip-req-build-f7hcw6xa/pip-egg-info/my_package.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-req-build-f7hcw6xa/pip-egg-info/my_package.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-req-build-f7hcw6xa/pip-egg-info/my_package.egg-info/requires.txt
      writing top-level names to /tmp/pip-req-build-f7hcw6xa/pip-egg-info/my_package.egg-info/top_level.txt
      writing manifest file '/tmp/pip-req-build-f7hcw6xa/pip-egg-info/my_package.egg-info/SOURCES.txt'
      error: package directory 'sub_module1' does not exist
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  </code></pre>
  
  <p>If <code>sub_module1</code> is there, and has an <strong>init</strong>.py file in it - why wouldn't the installation recognize it?</p>