Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"pip install --editable ./" vs "python setup.py develop"

People also ask

What is the difference between py pip and pip?

PIP is a soft link for a particular installer. pip3 is an updated version of pip which is used basically for python 3+. The system will use one of your Python versions depending on what exactly is first in the system PATH variable. When you run PIP3, you can be sure that the module will be installed in Python 3.

Does pip install use setup py?

@joeforker, pip uses setup.py behind the scenes.

Is setup py outdated?

py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. I found a very detailed write-up explaining this issue: "Why you shouldn't invoke setup.py directly" (October 2021).

What does setup py develop do?

For your own stuff, you want to first install your package and then be able to frequently edit the code without having to re-install the package every time — and that is exactly what python setup.py develop does: it installs the package (typically just a source folder) in a way that allows you to conveniently edit your ...


Try to avoid calling setup.py directly, it will not properly tell pip that you've installed your package.

With pip install -e:

For local projects, the “SomeProject.egg-info” directory is created relative to the project path. This is one advantage over just using setup.py develop, which creates the “egg-info” directly relative the current working directory.

More: docs

Also read the setuptools' docs.


One more difference: pip install -e uses wheel while python setup.py develop
doesn't use it.

With install, you could achieve the same behavior by using
pip install -e /path/to/package --no-use-wheel

More info on wheels : python wheels


Another difference that may favor pip install -e is that if your project has dependencies in install_requires in setup.py, then pip install -e . installs dependencies with pip, while python setup.py develop can install with easy_install, and may cause problems re: 'egg-info' as mentioned above. When install-requires uses dependency_links with custom git URLs, with attached egg identifiers, this can be especially annoying.


Yet another difference: when you run python setup.py develop for a version that is considered a pre-release (perhaps because you're running it from a git clone when not having checked out a release), then you will enable installation of pre-releases of your dependencies. On the other hand, with pip install --editable you would have to pass --pre explicitly if you want these pre-releases.

(See the CI log with pre-releases accidentally used and compare that to a fixed build here.)