Installing specific package versions with pip from git private repo

Viewed 254

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!

1 Answers

Easy enough:

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

Of course, assuming version 0.0.1 exists.

If your project is in a subfolder:

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

From the documentation

Related