pipenv: Unable to install package from private repository

I am attempting to install from a private repository. The output indicates the package and dependencies were installed but when pipenv is “Locking [packages] dependencies…”

I receive an error indicating: pip.exceptions.InstallationError: Could not detect requirement name, please specify one with #egg=

Describe your environment
  1. macOS 10.13.2
  2. Python version: Python 3.6.3
  3. Pipenv version: pipenv, version 9.0.3
Expected result

I am expecting for the package to install and the lockfile to be written.

Actual result
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Traceback (most recent call last):
  File "/Users/clayk/Library/Python/3.6/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/cli.py", line 1934, in install
    do_lock(system=system, pre=pre)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/cli.py", line 1102, in do_lock
    pre=pre
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/utils.py", line 545, in resolve_deps
    resolved_tree = actually_resolve_reps(deps, index_lookup, markers_lookup, project, sources, verbose, clear, pre)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/utils.py", line 470, in actually_resolve_reps
    constraint = pip.req.InstallRequirement.from_editable(dep[len('-e '):])
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/patched/pip/req/req_install.py", line 143, in from_editable
    editable_req, default_vcs)
  File "/Users/clayk/Library/Python/3.6/lib/python/site-packages/pipenv/patched/pip/req/req_install.py", line 1196, in parse_editable
    "Could not detect requirement name, please specify one with #egg="
pip.exceptions.InstallationError: Could not detect requirement name, please specify one with #egg=
Steps to replicate

execute pipenv install -e git+ssh://path/to/private/Redacted.git@v1.1.8#egg=privatepackagename

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 41 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I realize this issue is closed, but I have the exact same problem as @grudelsud (failed with error code 128 in None) and I’m on the latest version of pipenv. Not sure if a fix was deployed?

@techalchemy To install a private github repository from pip the syntax is pip install git+ssh://git@github.com/username/repo.git@branch#egg=blah

This worked properly with pipenv up to version 9 pipenv install git+ssh://git@github.com/username/repo.git@branch#egg=blah

but with pipenv 11 pipenv install git+ssh://git@github.com/username/repo.git@branch#egg=blah returns with the an error for git clone -q git@github.com/username/repo.git /tmp/temp it’s because the correct syntax should be git clone -q git@github.com:username/repo.git /tmp/temp with : and not /

hi all, I seem to have the same problem installing from a private repo with sources, and after reading this thread a few times it’s not clear to me if there’s any solution or workaround. here’s the problem I have, starting from an empty pipfile

pipenv install -e git+git@github.server.com:org/dataround.git#egg=dataround

shows the error in console

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "git clone -q ssh://git@github.server.com:org/dataround.git /var/folders/dg/ty_jfr9j40d9l0zw4gzn5x_h0000gn/T/tmpwj0_whscsource/dataround" failed with error code 128 in None

(basically having a : before the organisation name instead of a /) still it correctly installs the packages and generates the line dataround = {editable = true, git = "git@github.server.com:org/dataround.git"} in the Pipenv file

if I then

pipenv --rm
pipenv install

I have the same installation error as reported above and no package is installed (i.e. pipenv graph is completely empty).

I’m using python 3.6.5 with pip 18.0 and pipenv version 2018.7.1. Any help would be greatly appreciated.

This issue is quite old and was reported specifically about ssh:// prefixed requirements, so is not related to general case vcs requirements. It was fixed when it was closed in the first place.

As to your specific issue, you should check closed issues if possible, we have made a lot of changes and it’s hard to remember offhand which ones were done since the last release. Alternatively, you can grab the latest version of pipenv from here and see if your requirements.txt file parses correctly

Fixed in master, feel free to try it out and let me know if you continue to have issues

To clarify for everyone since there is confusion apparently:

@Moritz90 @clayk - the git+git@host syntax is the same thing as using git+ssh://git@host – pip itself does a drop in of ssh:// and we do this as well, this is the piece of code that currently is broken when you actually do use the more verbose format.

@hcoura your issue is unrelated, you are not using the correct syntax. You are using git+git@github.com/my/package.git and you need to be using a : instead of a /: git+git@github.com:my/package.git

@techalchemy thanks for feedback. I’m not sure I’ve done this the right way, but I’ve installed pipenv from git, i.e. pip3 install git+git://github.com/pypa/pipenv.git so that a pip freeze now reports pipenv==2018.7.1.dev0 (correctly matching version on master) then installed my private repo with sources, and still seeing the same error:

Locking [packages] dependencies…
[full stack trace omitted here]
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "git clone -q ssh://git@github.server.com:org/dataround.git /var/folders/dg/ty_jfr9j40d9l0zw4gzn5x_h0000gn/T/tmp8dlrr0zfsource/dataround" failed with error code 128 in None

should I try something different instead?

That’s not where the problem is but it is actually really helpful. If you use the git+git@ syntax it should work until I get a fix in place

git+git uses ssh on the backend. git:// is indeed a different protocol but is mostly deprecated although still usable. Either way this is working in the release if you don’t use quotes (mainly because we don’t treat -e as a cli flag). We can take a look at stripping those too, shouldn’t be too bad.

Kind of strange to accuse an unhandled exception of lying. The exception told you what it had a problem with. Still, this feel like a step in the right direction so I’ll look at it as a positive.

From https://pip.pypa.io/en/stable/reference/pip_install/#git

Here are the supported forms: … -e git+git@git.myproject.org:MyProject#egg=MyProject

Naturally if you use an ssh based approach you will need to have a password or a key pair for authentication. You can also use an http based approach which is not going to be impacted by this bug: git+https://git.myhost.org/myrepo.git#egg=myrepo

Please read the pip documentation if you want to know how to interact with vcs repositories.