title: Pip install from zip file on private server not installing requirements and when requirements met it does not find the package
body: <p>Ive made a command line tool to manage some actions on the server-side and I want to easely distribute it for my coworkers using pip install from a private server we have for internal tools, and to provide'em with updates on it, so we dont have to walk around with a thumbstick and doing boring 'pip install . -r requirements.txt' for every workstation there are.</p>
  
  <p>Id like to make it a very short question but I believe I must give as much intel on the setup and the project package to let you understand what is going wrong and how it is going wrong...</p>
  
  <p>I pretty much believe my problem lays on a bad config of the setup.py file on my part.</p>
  
  <p>First the server, it is a simple nginx pointing to a folder with basic auth .htpass, inside the folder I have the zipped project (maybe this is my first mistake?).</p>
  
  <p>To download and install using pip (python 3.5+) I simply run </p>
  
  <pre><code>pip install http://username:password@pip.myserver.io/tools/mypackage.zip
  </code></pre>
  
  <p>The first problem that happens is that the requirements in the setup.py are not downloaded.</p>
  
  <pre><code>import os
  from setuptools import setup
  from mypackage import __version__, project_name
  
  
  # Utility function to read the README file.
  # Used for the long_description.  It's nice, because now 1) we have a top level
  # README file and 2) it's easier to type in the README file than to put a raw
  # string in below ...
  def read(fname):
      return open(os.path.join(os.path.dirname(__file__), fname)).read()
  
  setup(
    name=project_name,
    version=__version__,
    description='Command line client for maintenance and odd jobs on the server',
    long_description=read('README.md'),
    classifiers=[
          "Development Status :: 2 - Alpha",
          "Topic :: Utilities :: Rest",
          "Framework :: Click",
          "Programming Language :: Python :: 3",
          "Programming Language :: Python :: 3.5",
    ],
    keywords='cli rest client admin',
    author="Myself",
    author_email='lucas@email.com',
    packages=['mypackage'],
    zip_safe=True,
    install_requires=[
        'certifi==2017.7.27.1',
        'chardet==3.0.4',
        'click==6.7',
        'idna==2.6',
        'requests==2.18.4',
        'urllib3==1.22',
        'terminaltables==3.1.0',
        'tqdm==4.19.4',
        'aiohttp==2.3.3',
        'aiodns==1.1.1',
        'cchardet==2.1.1',
        'async-timeout==2.0.0',
    ],
    entry_points='''
      [console_scripts]
          stp = mypackage.MyPackage:cli
          stp-config = mypackage.MyPackage:config
          ''',
    )
  </code></pre>
  
  <p>So it tries to download the zip file (and the setup.py marks as zip safe and I believe this might be my first mistake, but I can`t test it atm) but it does not install the requirements.</p>
  
  <p>The zip file has also de EGG folder of the installed package, I tried removing it, leaving it, absolutelly no difference whatsoever for the download/install, still breaks because it lacks the requisits.</p>
  
  <p>If I do install the requirements separated I can install myPackage using pip (finally!) but when I try to call it by its entrypoint</p>
  
  <pre><code>stp --help
  </code></pre>
  
  <p>I receive an error saying that 'mypackage is not present'.</p>
  
  <pre><code>C:\Users\Scoppio&gt;stp --help
  Traceback (most recent call last):
  File "C:\Users\Scoppio\AppData\Local\Programs\Python\Python36\Scripts\stp-script.py", line 11, in &lt;module&gt;
  load_entry_point('MyPackage==0.2.1', 'console_scripts', 'stp')()
  File "c:\users\scoppio\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 565, in load_entry_point
  return get_distribution(dist).load_entry_point(group, name)
  File "c:\users\scoppio\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 2631, in load_entry_point
  return ep.load()
  File "c:\users\scoppio\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 2291, in load
  return self.resolve()
  File "c:\users\scoppio\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 2297, in resolve
  module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "c:\users\scoppio\appdata\local\programs\python\python36\lib\site-packages\mypackage\__init__.py", line 1, in &lt;module&gt;
  from mypackage.my_client import myUrls
  ModuleNotFoundError: No module named 'mypackage.my_client '
  </code></pre>
  
  <p>You may notice that this error message is from a windows OS, but I get analogous errors on Mac OSX and Ubuntu 16</p>
  
  <p>And if I go to the folder which should have installed it inside the site-packages and open it, my package 'mypackage' has only the files there where inside the first folder level, for no apparent reason it discarded all the upper folders I had in place for the project.</p>
  
  <p>So my project structure was:</p>
  
  <pre><code>core/
      setup.py
      requirements.txt
      readme.md
      mypackage/
         __init__.py
         context.py
         my_package.py
         my_client/
            __init__.py
            rest_client.py
            my_urls.py
         my_plugins/
            __init__.py
            cmd_1.py
            cmd_2.py
            ...
            cmd_n.py
            utils/
               __init__.py
               print_table.py
  </code></pre>
  
  <p>but after installation with pip I am left with just those files</p>
  
  <pre><code>mypackage/
     __init__.py
     context.py
     my_package.py
  </code></pre>
  
  <p>I explored the temporary file pip makes but the whole project is present there, it simply does not install all the files I need.</p>
  
  <p>So far I only managed to install everything by manually adding the files missing, but it kills the point of using pip to install the project.</p>
  
  <p>I believe that I misunderstood the setuptools documentation and now I am tracing a few possible approaches, like adding more packages to the package entry in the setup, and using extra requirements instead of requirements.</p>