The simplest way to do this is certainly to edit the file in the venv, but as has been pointed out it's easy to lose track of that change and overwrite it. I do that anyway if it's a short term test.
However, my preferred approach when I want to modify a library like this is to clone its source code from Git, do the modifications in my cloned sandbox, and do a pip install -e . inside the module after having activated the venv. That will make this venv replace the previously installed version of the library with my sandbox version of it.
I want to use the "newenv" approach, but now I need to make changes to psynet (for example adding a log line or rpdb.set_trace()), where is this local copy? And can I simply change it or I need to reinstall the environment with reenv?
In psynet, if I use the "newenv" approach, how can I change the psynet code?