2

How to specify a local path for a dependency package in setup.py the install_requires key

my_workspace
| - my_new_package_root
|   | - setup.py **** my target setup.py
|   | - my_new_package
| - my_packag_root
|   | - setup.py
|   | - my_package

This is usually achieved using pip install -e my_package_root but I want to use the setup.py for that.

setup(
    ...,

    install_requires=['my_package'],
    ...
)

I found this, but it does not tell how to refer to local filesystem

pip3 setup.py install_requires PEP 508 git URL for private repo

Andreas Violaris
  • 2,465
  • 5
  • 13
  • 26
kerolos
  • 127
  • 1
  • 2
  • 10

2 Answers2

0

Use the file URL, eg:

install_requires=['my_package @ file:///absolute/path/my_package']
tekumara
  • 8,357
  • 10
  • 57
  • 69
0

You have to uses this syntax :

install_requires=['package @ file:///path/to/my/package']

Notes that you have to specify the absolute path for your package.

Enzo
  • 1
  • 1