Reputation: 1482
I'm trying to improve a package written in python . The package is already installed in the system. All the source files are also present . I want to create a copy of the package source so that i can make all the changes to the copy and test so that i do not make any change to the installed package . Is there a way for me to tell python to pick my copy of code instead of the Installed version whenever a file tries to import the package , so that i can test the new code in the copy ? I'm a noob with respect to python , so please do elaborate the solution
Upvotes: 0
Views: 107
Reputation: 6957
If you want to make change in the code; better will be; download its source code first; apply the changes; modify the setup.py
file or make new one; give it a new name.. . i mean do not change directly in the installed version; do them separately .. .or do whatever you like
but before doing all this; study the license agreements present in the original source by its author ; and this must be done carefully when you want to distribute your copy to others
Upvotes: 0
Reputation: 462
There's multiple ways to do it, but setting up virtual env would allow you two have two distinct environments that you can switch between.
Upvotes: 1