gargoylebident
gargoylebident

Reputation: 437

Modifying pip/conda packages inside site-packages

Is modifying Anaconda/pip packages (adding files, changing existing file contents when e.g. applying a fix that hasn't been pushed as the latest release on pip/conda) in envs/<env_name>/Lib/site-packages/<package_name> a good idea or not? Can this cause conflicts when updating in the future?

Upvotes: 0

Views: 1348

Answers (1)

D Malan
D Malan

Reputation: 11434

Yes, it's a very bad idea. It won't cause conflicts, instead, all of your changes will be lost when you update the package.

Rather find the package's repository, clone it, make your changes and install it from the repository or from a directory (outside of site-packages).

Check the Pip documentation on how to install from a VCS or local directory: https://packaging.python.org/tutorials/installing-packages/#installing-packages.

It's as simple as:

pip install -e path/to/SomePackage
# or
$ pip install -e git+https://github.com/username/package.git#egg=hyde

Upvotes: 3

Related Questions