I want to create a Python package. To make this work, the user needs to install multiple python packages. I also need the user to install a package that is currently only supported for installing straight from the source (i.e. pip install -e .
). How do I create my own source package, which depends on another source package in a clean way? In my opinion, it would be best if the user can just run python setup.py
once; which installs my package and all the requirements in requirements.txt
as well as the other package straight from the source.
I added a setup.py
file with the following content:
setuptools.setup(
dependency_links=["git+https://github.com/facebookresearch/pytorch-dp.git#egg=pytorch-dp"],
packages=setuptools.find_packages(),
python_requires=">=3.6",
)
When I run the setup file I get:
Moving pytorch_dp-0.1-py3.6.egg to /usr/local/lib/python3.6/dist-packages
Adding pytorch-dp 0.1 to easy-install.pth file
but then if I try to import the package torchdp
:
import torchdp
I get the error:
ModuleNotFoundError: No module named 'torchdp'
I'm using a Google Colab Notebook for GPU support.*
-e
and "straight from source" are not the same in my understanding. For me, "straight from source" might just be something likepip install git+https://github.com/tangentlabs/django-oscar-paypal.git
. Could you clarify where the other dependencies are located? do they come from a git repo, do you package them with your application ...?