Home > Mobile >  How can I edit a GitHub repository (for a Python package) locally and run the package with my change
How can I edit a GitHub repository (for a Python package) locally and run the package with my change

Time:02-03

I have cloned a GitHub repository that contains the code for a Python package to my local computer (it's actually on a high performance cluster). I have also installed the package with pip install 'package_name'. If I now run a script that uses the package, it of course uses the installed package and not the cloned repository, so if I want to make changes to the code, I cannot run those. Is there a way to do this, potentially with pip install -e (but I read that was deprecated) or a fork? How could I then get novel updates in the package to my local version, as it is frequently updated?

CodePudding user response:

If you run an IDE like PyCharm, you can mark a folder in your project as Sources Root. It will then import any packages from that folder instead of the standard environment packages.

CodePudding user response:

In the end I indeed did use pip install -e, and it is working for now. I will figure it out once the owner of the package releases another update!

  • Related