Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update a local package with pip [duplicate]

Tags:

python

pip

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?

like image 735
MetallicPriest Avatar asked Jan 17 '26 08:01

MetallicPriest


1 Answers

I do the following to update a local python package:

  1. Using -e flag tells pip 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.
  2. Using -U flag tells pip install to upgrade the package.

So, in your case, following should work:

pip install -e your_package_directory
like image 110
YOLO Avatar answered Jan 19 '26 22:01

YOLO



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!