The question is really simple: I have a python package installed using pip3 and I'd like to tweak it a little to perform some computations. I've read (and it seems logical) that is very discouraged to not to edit the installed modules. Thus, how can I do this once I downloaded the whole project folder to my computer? Is there any way to, once edited this source code install it with another name? How can I avoid mixing things up? Thanks!
- I agree it's discouraged. That being said, this question will show you where to find the package. You can make your edits there, save the file and make sure to delete any corresponding (or all) *.pyc files in that directory (they're cached module bytecode and if they exist will be used instead of the source you just edited).jedwards– jedwards2019-08-15 03:31:26 +00:00Commented Aug 15, 2019 at 3:31
Add a comment |
1 Answer
You can install the package from its source code, instead of PyPi.
- Download the source code - do a
git clone <package-git-url>of the package - Instead of
pip install <package>, install withpip install -e <package-directory-path> - Change code in the source code, and it will be picked up automatically.