简体   繁体   English

如何从下载的 git 存储库安装

[英]How to install from a downloaded git repository

I have been given a link to a github repository and informed to install using pip install rep-name unfortunately I was advised not to share the exact URL for now, so I will use rep-name .我已经获得了一个 github 存储库的链接,并被告知使用 pip install rep-name进行安装,不幸的是,我被建议暂时不要分享确切的 URL,所以我将使用rep-name This question may be related to Install a downloaded package from GitHub but I am not using npm.这个问题可能与从 GitHub 安装下载的包有关,但我没有使用 npm。

In Jupyter notebook I used the following:在 Jupyter 笔记本中,我使用了以下内容:

pip install git+https://github.com/xyz/rep-name.git

But got errors like: Host key verification failed.但出现如下错误:主机密钥验证失败。 fatal: Could not read from remote repository.致命:无法从远程存储库中读取。

Now I have downloaded the repository as zip folder and placed it in C:\MyFolder.现在我已将存储库下载为 zip 文件夹并将其放在 C:\MyFolder 中。 How can I run pip install on that zipped folder?如何在该压缩文件夹上运行 pip install ?

The easiest way to do this is most likely by first downloading using git and then installing with pip eg最简单的方法很可能是首先使用 git 下载,然后使用 pip 安装,例如

Optionally, you can clone the repro again to assure non of your previous changes interfere with the installation.或者,您可以再次克隆 repro 以确保您之前的更改不会干扰安装。

git clone https://github.com/xyz/rep-name.git repro_name

If all is good you can just cd into your repro and install:如果一切都很好,您可以直接进入您的复制并安装:

cd repro_name
pip install -e .

Note that any changes that will be made to the repro will be automatically updated in the your environment due to the editable (-e) tag.请注意,由于可编辑 (-e) 标记,将对重现进行的任何更改都将在您的环境中自动更新。

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

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