Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between setup.py install and setup.py develop

I am trying to improve my workflow when developing python modules and have a rather basic question.

What exactly happens when choosing either option. To my knowledge develop leaves the files in place so I can modify them and play around with the package whereas install copies them in the site-packages folder of my python installation. How is the package linked to my python installation when using the develop option.

like image 597
tim Avatar asked Dec 02 '13 22:12

tim


People also ask

What is difference between Python pip install and pip install?

They do exactly the same thing. In fact, the docs for distributing Python modules were just updated to suggest using python -m pip instead of the pip executable, because it's easier to tell which version of python is going to be used to actually run pip that way.

Is setup py install deprecated?

With the latest version of setuptools, the python setup.py install command is being deprecated (see https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for more info).

How Python setup py install?

To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

What does setup py Sdist do?

The sdist command processes this template and generates a manifest based on its instructions and what it finds in the filesystem. If you prefer to roll your own manifest file, the format is simple: one filename per line, regular files (or symlinks to them) only.


1 Answers

develop creates an .egg-link file in the site-packages directory, which points back to the location of the project files. The same path is also added to the easy-install.pth file in the same location. Uninstalling with setup.py develop -u removes that link file again.

Do note that any install_requires dependencies not yet present are also installed, as regular eggs (they are easy_install-ed). Those dependencies are not uninstalled when uninstalling the development egg.

like image 52
Martijn Pieters Avatar answered Sep 22 '22 22:09

Martijn Pieters