Question

The dependencies of A Python package are declared in a file called setup.py, under the key install_requires, e.g.:

  install_requires=[
      'Flask >= 0.10.1',
      'requests >= 2.2.1',
      'jsonschema >= 2.3.0',
      'nose >= 1.3.0',
      'behave >= 1.2.4'
  ]

The dependencies for tests are declared under the key tests_requires.

When the package is installed (by using python setup.py install), the dependencies are fetched from The Python Package index (pypi.python.org).

Is there a way to install the package, and let it fetch its dependencies from a local package repository, like pypiserver?

This way I can cache frequently-used packages, and install internal packages that do not exist in PyPi.

I am probably looking for something like:

python setup.py install 
      --repo http://127.0.0.1:8000/localrepo 
      --fallback-repo http://pypi.python.org
Was it helpful?

Solution

With PIP cache you could install the dependencies more one time.

Adding to ~/.bash_profile the next line:

export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache

See the next link https://stackoverflow.com/a/4806458/3380763

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top