简体   繁体   中英

Does the Python Package Manager **pip** have something like yarn link?

I am wanting to fork a python (pip) dependency that I am using and make some edits to it, etc. And I don't want to risk a pip update/upgrade erasing my changes.

In the javascript world, and easy way to do what I want to do is with the yarn link command.

Is there a command similar to yarn link when using python/pip?

So, I found out how to do this. Instead of doing a normal pip install, you can do the following:

  • Checkout a repo of the forked package
  • Then, run this command
pip install -e /path/to/the/package/on/local/file/system

This creates an editable install of the package in the folder of your choosing, so you can develop and make changes and see the effect of the changes immediately.

I'm sure seasoned python developers already know this. But I'm not in python everyday. I've been wanting to know how to do this for a long time. Finally figured it out. I hope this helps someone else!

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