pip install with relative paths in pyproject.toml doesn't seem to work
See original GitHub issueHow do I specify relative paths that pip can use in pyproject.toml?
poetry successfully installs them, however pip fails with the following error:
File "/tmp/pip-build-env-ck09aiax/overlay/lib/python3.7/site-packages/poetry/core/packages/directory_dependency.py", line 36, in __init__
raise ValueError("Directory {} does not exist".format(self._path))
ValueError: Directory ../lib_foo does not exist
Example
I have the following repository structure
.
βββ lib_foo
β βββ lib_foo
β β βββ __init__.py
β βββ pyproject.toml
βββ main_app
βββ main_app
β βββ __init__.py
βββ pyproject.toml
main_app is dependent upon lib_foo, its dependecies looks like this:
./main_app/pyproject.toml
[tool.poetry.dependencies]
python = "^3.7"
lib-foo = { path = "../lib_foo" } # also tried path = "../lib_foo/"
when doing:
./main_app$ poetry install # runs successfully
./main_app$ python -m pip install ../lib_foo/ # runs successfully
./main_app$ python -m pip install . # fails with the error mentioned above
./main_app$ python -m pip --version
pip 20.1.1 from ./main_app/my_venv/lib/python3.7/site-packages/pip (python 3.7)
I am using poetry when developing a project however when deploying them I want to only use pip
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
pip install with relative paths in poetry - Stack Overflow
I am pretty sure pip can not handle dependencies with relative paths. Absolute paths might be okay. The way I see it, pip...
Read more >What is the correct interpretation of path-based PEP 508 ...
We assume this is always a filesystem path and interpret it relative to the parent directory of the unpacked filesystem resource we consider...
Read more >The pyproject.toml file | Documentation | Poetry
README paths are implicitly relative to pyproject.toml . The contents of the README file(s) are used to populate the Description field of your...
Read more >Changelog - pip documentation v22.3.1
Support editable installs for projects that have a pyproject.toml and use a build ... Correctly handle relative cache directory provided via --cache-dir.
Read more >Flit Documentation
python3 -m pip install flit. 3. Run flit init in the directory containing the module to create a pyproject.toml file. It will look...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You should not be able to build the package, since it is not allowed to have dependencies specified as relative paths in package metadata. PEP 508 only allows version specifiers and URL (which only allows absolute paths even if you use
file://). Poetry should fix this.Consequence of #7555. May be resolved with #9091.