简体   繁体   中英

How can I edit a GitHub repository (for a Python package) locally and run the package with my changes?

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?

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM