pip: Cannot install top-level git repo over SSH
pip version
21.0.1
Python version
3.9.1
OS
linux
Additional information
No response
Description
I have an SSH server, say git.myserver.com, which hosts the git repos for some of my personal projects. In the past I could just:
$ pip install -e git+git@git.myserver.com:myproject.git#egg=myproject
Attempting to do this using the new format does not seem to be supported:
$ pip install -e git+git@git.myserver.com/myproject.git#egg=myproject
Cloning ssh://****@git.myserver.com/myproject.git to ./src/myproject
Running command git clone -q 'ssh://****@git.myserver.com/myproject.git' /home/.../myproject
fatal: '/myproject.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Expected behavior
To be able to install packages that are at the top-level of my git/ssh server.
How to Reproduce
- Put a package at the root of a server you can access via SSH
- Attempt to install over SSH with pip
- An error occurs - it seems like pip is trying to read “/myproject.git” when it should be using “myproject.git”
Output
Cloning ssh://****@git.myserver.com/myproject.git to ./src/myproject
Running command git clone -q 'ssh://****@git.myserver.com/myproject.git' /home/.../myproject
fatal: '/myproject.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Code of Conduct
- I agree to follow the PSF Code of Conduct
Please advise on how to resolve this issue. It is preventing installing privately-managed packages.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 23 (8 by maintainers)
Here is what I get:
What I expect is that pip does not interpret the repo name as an absolute path. Previously I would use a colon to indicate the remote repo I was installed, e.g. (old version):
But because this old-style “scp” syntax is not supported, it looks like I need to pass the full path to pip.
Here is how I am working around it:
In
ssh://you separate the domain and the path with a slash (/), not a colon (:). Please read your input cafully and compare thow it’s different from the examples.something like this works for me