简体   繁体   English

Python软件包管理器** pip **是否具有类似于yarn链接的内容?

[英]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. 我想派生一个我正在使用的python(pip)依赖关系,并对它进行一些编辑,等等。而且我不想冒着pip更新/升级擦除我的更改的风险。

In the javascript world, and easy way to do what I want to do is with the yarn link command. 在javascript世界中,做我想做的简单方法是使用yarn link命令。

Is there a command similar to yarn link when using python/pip? 使用python / pip时是否存在类似于yarn link的命令?

So, I found out how to do this. 因此,我了解了如何执行此操作。 Instead of doing a normal pip install, you can do the following: 您可以执行以下操作来代替进行常规的pip安装:

  • 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. 我相信经验丰富的python开发人员已经知道这一点。 But I'm not in python everyday. 但是我不是每天都在使用python。 I've been wanting to know how to do this for a long time. 我一直想知道如何做到这一点。 Finally figured it out. 终于想通了。 I hope this helps someone else! 我希望这可以帮助其他人!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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