How can I make setuptools (or distribute) install a package from the local file system

放肆的年华 提交于 2019-12-03 09:48:20

I had an identical problem where I needed to depend on modules in a sibling folder. I was able to find a solution after stumbling upon https://caremad.io/2013/07/setup-vs-requirement/

I ended up requirements.txt to refer specifically to the file I wanted, and then installing everything with

pip install -r requirements.txt

requirements.txt

-e ../utils                                                                                                                                                                    
-e .

And setup.py has all my other dependencies, including utils. When pip tries to install app1 itself, it realizes that the utils dependency has already been filled, and so passes over it, while installing the other requirements.

When I want to work with a set of projects interrelated, I install all of them using /setup.py develop.

If I mistakenly or later I want to make a pip-installed module editable, I clone the source, and do a python setup.py develop on it too, substituting the existing one.

Just to get sure, I erase the reference in the virtualenv's site-packages and the package itself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!