Search code examples
pythonpippython-poetry

pip: installing a library from local path, and resolving its (remote) dependencies


I'm "publishing" a private python library, but most of its consumers will probably want to pull its source code and install it locally for various reasons. (I also want to guide other developers how to develop locally)

So let's say I have my_library (declaring version 0.1.0) at someloc/my_library.

The only pip command I managed to run and succeeded was:

pip install --pre --find-links my_library==0.1.0 file:///Users/me/someloc/my_library

However, it also outputs these errors for every dependency it installs:

WARNING: Location 'my_library==0.1.0' is ignored: it is either a non-existing path or lacks a specific scheme.

I'm assuming this is because pip rightfully assumes I want to find those links in my_library==0.1.0, which is invalid of course.

So, how can I, from another local project (that uses pip and no poetry), install a local library and its dependencies properly? (in non-editable mode)


Solution

  • Silly, but I shouldn't specify the library name. So the correct way to install locally is:

    pip install --pre /Users/me/someloc/my_library