pip: pip 10 is unable to install from non-editable VCS URLs

  • Pip version: 10.0.0
  • Python version: 3.5.4
  • Operating system: Linux

Description:

I’m trying to install a package from Git.

What I’ve run:

$ pip3 install git+ssh://git@example.com/mypackage.git#egg=mypackage
Building wheels for collected packages: mypackage
Exception:
Traceback (most recent call last):
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 305, in run
    session=session, autobuilding=True
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 773, in build
    python_tag=python_tag,
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 633, in _build_one
    python_tag=python_tag)
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 637, in _build_one_inside_env
    if self.__build_one(req, temp_dir.path, python_tag=python_tag):
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 663, in __build_one
    base_args = self._base_setup_args(req)
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 659, in _base_setup_args
    SETUPTOOLS_SHIM % req.setup_py
  File "/home/p/local/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 416, in setup_py
    assert self.source_dir, "No source dir for %s" % self
AssertionError: No source dir for mypackage from git+ssh://git@example.com/mypackage.git#egg=mypackage in /home/p/local/lib/python3.5/site-packages

If I uninstall the package and then install, it works. But it continues to fail when trying install again.

About this issue

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

Most upvoted comments

@pradyunsg I didn’t do extensive testing, but #5280 resolves the issue for our case.

In case others are also debugging this. I’ve narrowed down the two paths, first install and reinstall, to the difference in the results coming out of the resolver’s _get_abstract_dist_for. Prior to that call both paths have <InstallRequirement>.source_dir == None. After this call, only the first install path has a source_dir set to something other than None. I’m guessing this is because it needs to go off and fetch the source during the first-install, but not on the reinstall.

… I could be off in the weeds though. It is my first time looking at this code. 😕

Also experiencing this issue with pip 10.0.0 This breaks our ops/build workflows. 😢

I saw this same error on Python 2 and found that using pip 9 worked as expected. I wonder if this is related to the deprecation and removal of the egg switch? Removing that also seemed to solve the issue.