Karl 17302
Karl 17302

Reputation: 77

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. This question may be related to Install a downloaded package from GitHub but I am not using npm.

In Jupyter notebook I used the following:

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. How can I run pip install on that zipped folder?

Upvotes: 2

Views: 8158

Answers (3)

Wally Froyer
Wally Froyer

Reputation: 1

i clonded a git from github. cd clonedirectory. here is the rest copied off the screen: pip install -e

Usage:
pip install [options] [package-index- options] ... install [options] -r [package-index-options] ... pip install [options] [-e] ... pip install [options] [-e] ... pip install [options] <archive url/path> ...

       -e option requires 1 argument

Maybe you shouldnt assume your answers will work for everyone because clearly not for me on debian. 12.5.

Upvotes: -1

Olivier Simard-Hanley
Olivier Simard-Hanley

Reputation: 37

Direct answer to your question:

First, unzip the downloaded file with :

!unzip repo_name.zip -d path/to/folder

Then, navigate to the repo and run the installation script.

cd path/to/folder/repo_name
pip install -e .

Upvotes: 0

Jop Knoppers
Jop Knoppers

Reputation: 714

The easiest way to do this is most likely by first downloading using git and then installing with pip e.g.

Optionally, you can clone the repro again to assure non of your previous changes interfere with the installation.

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.

Upvotes: 4

Related Questions