0

I have a package that I'm writing for internal use at the company I work at and I'd like to be able to host my package locally with different versions. I've already read python pip - install from local dir but it did not address my specific question.

What I envision is having a directory that contains wheels for the various versions of the packages I'm writing like below:

.. local_distributions
.    
|-- my_package
|   |-- my_python_package-0.0.0-py3-none-any.whl
|   |-- my_python_package-0.0.1-py3-none-any.whl
|   |-- my_python_package-0.0.2-py3-none-any.whl

How could I use pip to install a specified version of my local package from the directory containing the various wheel files? Ideally, it would be nice if I could add this folder to the pip search path so that I could just type the command below and have things work:

pip install my_python_package==0.0.1

thanks!

Nick-H
  • 342
  • 1
  • 3
  • 15
  • You can use `pip install my_python_package --find-links=local_distributions/my_package`, however it only works with flat dirs (no recursing into subdirs), so you could put all wheels into `local_distributions` and install via `pip install my_python_package --find-links=local_distributions`. – hoefling Apr 22 '21 at 16:46
  • Otherwise, if your wheels are grouped in subdirectories carrying the package names (e.g. `my_python_package-0.0.0-py3-none-any.whl` is located in `my_python_package` and not in `my_package` as in your question), you can run a local index server via `python -m http.server 9000 --directory local_distributions` and install via `pip install my_python_package --extra-index-url=http://127.0.0.1:9000`. Check out [my answer](https://stackoverflow.com/a/51127695/2650249) for more details on that (global configuration and stuff). – hoefling Apr 22 '21 at 16:46

0 Answers0