1
Hello. I’ve only been learning Python for a short time. I’m now trying to create my own packages. This helps organize the code.
But I had a question: would anyone know how to install my packages so that they are available for all my projects?
An idea would be to copy them manually to the directory of each project, but besides not being anything elegant, I’ll have to copy them again when there are changes in the packages. Certainly not a good solution.
So, is it possible to use the Pip to install my packages in my projects and update them when necessary?
Could someone clarify on this subject? Is there any other procedure more suitable to do this management of my own packages?
Thanks for the help.
PS.: using Python 3.9.1, Pycharm and Win10.
Great explanation. I have a question about "Pip install -e": with this option it is unnecessary to use "Pip install -U" to update the installation of a package?
– jalexm
The
pip install -e
makes Python use the project of the folder it is currently in. Without the-e
it copies the files to the folderlib/site-packages
of the virtual-env, and now uses the copy made at that moment. As with -e it uses the files you are editing, you do not need to be using the "-U" all the time, but when you upload the version, change the prerequisite version, or change the setup.py, then you need the-U
yes, which may be along with the-e
:pip install -U -e .
– jsbueno