Leonardo
Leonardo

Reputation: 1891

Installing specific package versions with pip from git private repo

I'm deploying some custom packages with pip straight from my company's private git repo (and it's awesome). But what if I want to install a specific version of my package?

This question completements Specify extras_require with pip install -e.

I'm trying to install it with:

pip install git+https://github.com/user/project.git#egg=project==0.0.1[extra]

But I get a ERROR: Invalid requirement: 'project==0.0.1[extra]' message.

Thanks!

Upvotes: 5

Views: 1440

Answers (1)

Leonardo
Leonardo

Reputation: 1891

Easy enough:

pip install git+https://github.com/user/[email protected]#egg=project[extra]

Of course, assuming version (see the note below) 0.0.1 exists.

If your project is in a subfolder:

pip install "git+https://github.com/user/[email protected]#egg=project[extra]&subdirectory=my_subprojects/subproject"

From the documentation

  • Note:

Thanks @dukesilver and @neilg for comments! Yes, by "version" I meant "assuming a branch or tag exists in git which is named 0.0.1"

Upvotes: 1

Related Questions