Hey,
I have some problem with installing from ssh-repos. I first thought this was a problem with gitlab, but I have the same problem on github.
pipenv install -e "[email protected]:Corvan/upyls.git#egg=upyls" fails. Does not matter if I use the ssh:// way of defining the repo and it fails with any other git repo over ssh for me. Tried this as well in a completely new (empty) pipenv folder.
I have loaded my ssh-key via ssh-add, and I can successfully run git clone [email protected]:Corvan/upyls.git
Installing the package works
18-12-26 14:31:12 lars@Denephor:/home/lars/Workspace/pipenvtest $ pipenv install -e "[email protected]:Corvan/upyls.git#egg=upyls"
Installing -e [email protected]:Corvan/upyls.git#egg=upyls...
Adding upyls to Pipfile's [packages]...
✔ Installation Succeeded
Pipfile.lock (494624) out of date, updating to (a65489)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
â ™ Pinning VCS Packages...ssh: connect to host github.com:Corvan port 22: Connection refused
fatal: Konnte nicht vom Remote-Repository lesen. (Could not read from remote repository)
Bitte stellen Sie sicher, dass die korrekten Zugriffsberechtigungen bestehen
und das Repository existiert. (Please make sure you have the proper rights to access the repository and make sure it exists)
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/cli/command.py", line 254, in install
editable_packages=state.installstate.editables,
File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1992, in do_install
skip_lock=skip_lock,
File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1221, in do_init
pypi_mirror=pypi_mirror,
File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1068, in do_lock
lockfile=lockfile
File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 626, in venv_resolve_deps
dev=dev,
File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 1311, in get_vcs_deps
with locked_repository(requirement) as repo:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 1447, in locked_repository
with requirement.req.locked_vcs_repo(src_dir=src_dir) as repo:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/requirements.py", line 840, in locked_vcs_repo
vcsrepo = self.get_vcs_repo(src_dir=src_dir)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/requirements.py", line 802, in get_vcs_repo
vcsrepo.obtain()
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/vcs.py", line 37, in obtain
self.repo_instance.obtain(self.checkout_directory)
File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/notpip/_internal/vcs/__init__.py", line 332, in obtain
self.fetch_new(dest, url, rev_options)
File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/notpip/_internal/vcs/git.py", line 198, in fetch_new
self.run_command(['clone', '-q', url, dest])
File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/notpip/_internal/vcs/__init__.py", line 456, in run_command
spinner=spinner)
File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
% (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "git clone -q ssh://[email protected]:Corvan/upyls.git /tmp/requirementslibIhzu9R/upyls" failed with error code 128 in None
Create a new empty folder and run pipenv install -e "[email protected]:Corvan/upyls.git#egg=upyls"
$ pipenv --support
Pipenv version: '2018.11.26'
Pipenv location: '/usr/local/lib/python2.7/dist-packages/pipenv'
Python location: '/usr/bin/python'
Python installations found:
3.7.1: /usr/bin/python3.73.6.7: /usr/bin/python3.63.6.7: /usr/bin/python3.6m3.7.1: /usr/bin/python3.7m2.7.15: /usr/bin/python2PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '0',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.18.0-13-generic',
'platform_system': 'Linux',
'platform_version': '#14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018',
'python_full_version': '2.7.15+',
'python_version': '2.7',
'sys_platform': 'linux2'}
System environment variables:
USERNAMEVIRTUAL_ENV_DISABLE_PROMPTQT_QPA_PLATFORMTHEMELESSLC_CTYPEWINDOWPATHXDG_CURRENT_DESKTOPXDG_SESSION_TYPELOGNAMEUSERPATHXDG_VTNRHOMEZSHKDE_SESSION_VERSIONKDE_FULL_SESSIONLANGPROFILEHOMETERMSHELLCOLORFGBGXAUTHORITYLANGUAGESESSION_MANAGERSHLVLXDG_SESSION_IDMANDATORY_PATHKONSOLE_PROFILE_NAMESHELL_SESSION_IDDISPLAYQT_ACCESSIBILITYWINDOWIDSSH_AGENT_PIDXDG_RUNTIME_DIRLIBVIRT_DEFAULT_URIGPG_AGENT_INFOKICAD_PATHKONSOLE_DBUS_SESSIONQT_AUTO_SCREEN_SCALE_FACTORGTK2_MODULESXDG_SESSION_DESKTOPSSH_AUTH_SOCKCOLORTERMPYTHONPATHKDE_SESSION_UIDKONSOLE_DBUS_SERVICEGDMSESSIONPIP_SHIMS_BASE_MODULEGTK2_RC_FILESPIP_PYTHON_PATHPYTHONDONTWRITEBYTECODEGS_LIBDBUS_SESSION_BUS_ADDRESS_KIGITHUBDESKTOP_SESSIONLSCOLORSXDG_CONFIG_DIRSDEFAULTS_PATHXCURSOR_THEMEPIP_DISABLE_PIP_VERSION_CHECKOLDPWDGTK_MODULESXDG_DATA_DIRSPWDPYTHONFINDER_IGNORE_UNSUPPORTEDGTK_RC_FILESXCURSOR_SIZELS_COLORSPAGERXDG_SEATPipenv–specific environment variables:
Debug–specific environment variables:
PATH: /home/lars/bin:/home/lars/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/binSHELL: /usr/bin/zshLANG: de_DE.UTF-8PWD: /home/lars/Workspace/pipenvtestContents of Pipfile ('/home/lars/Workspace/pipenvtest/Pipfile'):
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
upyls = {git = "[email protected]:Corvan/upyls.git",editable = true}
[requires]
python_version = "3.7"
Contents of Pipfile.lock ('/home/lars/Workspace/pipenvtest/Pipfile.lock'):
{
"_meta": {
"hash": {
"sha256": "7e7ef69da7248742e869378f8421880cf8f0017f96d94d086813baa518a65489"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {},
"develop": {}
}
git clone -q ssh://[email protected]:Corvan/upyls.git
ssh: Could not resolve hostname github.com:Corvan: nodename nor servname provided, or not known
yes, I have them same with ssh:// but not without:
git clone [email protected]:Corvan/upyls.git
I found the solution:
it must be
pipenv install -e "[email protected]/Corvan/upyls.git#egg=upyls"
It must be written as absolute path with a / not with a colon, maybe it might help, adding a note here to the documentation.
the mentioned solution is a workaround, it will not work going forward.
The actual solution is to use the full ssh url: git+ssh://[email protected]/Corvan/upyls.git#egg=upyls until we release the new version of pipenv with an updated requirementslib release.
Note that for the format you are using here, pip specifically indicates that the colon is the required syntax. From the documentation (note the last example, the only one which matches your syntax).
[-e] git://git.example.com/MyProject#egg=MyProject
[-e] git+http://git.example.com/MyProject#egg=MyProject
[-e] git+https://git.example.com/MyProject#egg=MyProject
[-e] git+ssh://git.example.com/MyProject#egg=MyProject
[-e] git+git://git.example.com/MyProject#egg=MyProject
[-e] git+file:///home/user/projects/MyProject#egg=MyProject
-e [email protected]:MyProject#egg=MyProject
The important distinction here is that the parser reads the element before the + as the VCS indicator and splits it off, then it either parses the scheme as defined by whatever spec defines URI standards, but which includes everything until ://. IF there is no scheme present _and_ the line is prefixed with a VCS prefix, the parser _assumes_ it is an ssh connection and prefixes it for you. Additionally it reformats the URL accordingly.
Most helpful comment
I found the solution:
it must be
pipenv install -e "[email protected]/Corvan/upyls.git#egg=upyls"It must be written as absolute path with a / not with a colon, maybe it might help, adding a note here to the documentation.