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.
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.
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).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With