E. Edwards
E. Edwards

Reputation: 418

How to install a .zip package via requirements.txt?

I've got URL similar tohttps://github.com/me/my-project/archive/master.zip

During development, I was able to install it with:

pip install https://github.com/me/my-project/archive/master.zip

How would I go about adding that to requirements.txt? I can only see options for repositories.

Thanks.

Upvotes: 5

Views: 4296

Answers (4)

E. Edwards
E. Edwards

Reputation: 418

I found out a way to add a VCS source without using a link to the .zip file. This needs to be added to requirements.txt:

-e git+https://github.com/me/my-project/#egg=my-project

Upvotes: 2

Karson Jo
Karson Jo

Reputation: 1712

It seems that in the current version you just need to bring in the path to the zip package directly:

# requirements.txt
https://github.com/me/my-project/archive/master.zip

Then... it's done. No need to specify any additional information.

Upvotes: 3

Kirill Vercetti
Kirill Vercetti

Reputation: 43

Without third-party dependencies out of the box, you can do this by simply adding the following line to requirements.txt:

my-project @ https://github.com/me/my-project/archive/master.zip

Upvotes: 2

ChrisDanger
ChrisDanger

Reputation: 1207

The accepted answer didn't work for me only because the package I am using needs to be installed directly from a zip that's been downloaded from github.

But, this worked for me:

from pip._internal import main as pipmain
pipmain(['install', 'package-downloaded-from-github-master.zip'])

Which I got from here: How can I install a github zip file with pip and setup.py from requirements.txt?

Upvotes: 0

Related Questions