Reputation: 3737
So I was trying to modify an existing library and instead of doing it the smart way and using pip -e
I instead just installed the libraries, then swapped the modified files for whatever changes I wanted. For example if I had:
Library A/
---doSomethingA.py
---otherFiles.py
I just deleted doSomethingA.py
and replaced it with my version of doSomethingA.py
. Theoretically I figured, because im editing the file locally, it should still work as planned for my library with whatever extra functionality I want.
HOWEVER.... its basically going crazy. While I can see my edited changes in the file, when I run the library its obviously not running that file. I did things like:
commenting out the whole file (still runs somehow)
Actually uninstalling the library and part of another script using doSomethingA.py
it still runs?? (i.e Something like import libraryA
works on JupyerHub
, but not on the putty
terminal... ?)
I've obviously come to the conclusion that its not running the file that it says that it is (and trust me I've checked the path of the file like 10 times).
My question is:
I've also deleted the __pychache__
, but I can't think of anything else to do. Is my best option to just give up and create a new virtual environment, etc?
Upvotes: 0
Views: 187
Reputation: 5755
I understand that you are running on jupyter hub.
This means that your python is running remotly on the server and the framework is taking care to synch your local project (but not the installed libraries).
The python on the server is not aware of your local change.
As a temporary mitigation you can copy the installed library to you project root.
Upvotes: 1