The answers here show how to install a local package using pip. However, I am also interested in knowing how to update a package. For example, if I previously had installed package with version 1.0.0, and now I want to replace it with 1.0.1, how would I do that? One method I can think of is to use pip uninstall and then install the new one, but is there a more elegant way?
Asked
Active
Viewed 5,507 times
2
-
1@YOLO: Maybe you can put it as the answer, also describing it a little bit. – MetallicPriest Jan 02 '20 at 11:19
-
https://stackoverflow.com/search?q=%5Bpip%5D+update+package – phd Jan 02 '20 at 15:07
1 Answers
7
I do the following to update a local python package:
- Using
-e
flag tellspip install
to read package in an editable mode, which means you don't need to reinstall the package after making your changes. They get detected automatically. - Using
-U
flag tellspip install
to upgrade the package.
So, in your case, following should work:
pip install -e your_package_directory

YOLO
- 20,181
- 5
- 20
- 40