[英]How to modify / edit an installed anaconda package
I have some issues with a published package and wish to edit the code myself (may generate a pull request later to contribute).我对已发布的包有一些问题,并希望自己编辑代码(稍后可能会生成拉取请求以进行贡献)。 I am quite confused about how to do this since it seems there is a lack of step-by-step guidance.我对如何做到这一点感到很困惑,因为似乎缺乏分步指导。 Could anybody give me a very detailed instruction about how this is done (or a link)?任何人都可以给我一个关于如何完成的非常详细的说明(或链接)吗? My understanding and also my questions about the workflow are:我的理解以及我对工作流程的问题是:
You can simply git-clone the package repo to your local computer and then install it in " development " or " editable " mode.您可以简单地将包 repo git-clone 到您的本地计算机,然后以“开发”或“可编辑”模式安装它。 This way you can easily make changes to the code while at the same time incorporating it into your own projects.通过这种方式,您可以轻松地更改代码,同时将其合并到您自己的项目中。 Of course, this will also allow you to create pull requests later on.当然,这也将允许您稍后创建拉取请求。
Using Anaconda (or Miniconda) you have 2 equivalent options for this:使用 Anaconda(或 Miniconda),您有 2 个等效选项:
conda develop <path_to_local_repo>
pip install --editable <path_to_local_repo>
What these commands basically do is creating a link to the local repo-folder inside the environments site-packages folder.这些命令的基本作用是在环境站点包文件夹中创建一个指向本地 repo 文件夹的链接。
Note that for " editable " pip installs you need aa basic setup.py :请注意,对于“可编辑” pip 安装,您需要一个基本的setup.py :
import setuptools
setuptools.setup(name=<anything>)
On the other hand the conda develop <path_to_local_repo>
command unfortunately doesn't work in environment.yml files.另一方面,不幸的是conda develop <path_to_local_repo>
命令在environment.yml文件中不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.