question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bbakersmithcommented, Apr 18, 2018

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

1reaction
mmulichcommented, Apr 16, 2018

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. 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip freeze, vcs urls and pep 517 (feat. editable installs)
I assume this workflow is fairly common? Notice the editable (-e) option to install vcs dependencies, which is necessary so pip freeze works ......
Read more >
How can I install from a git subdirectory with pip?
I have a git repository with many folders, one of them being a python module installable with pip, like this ...
Read more >
pip install - pip documentation v22.3.1
Install packages from: PyPI (and other indexes) using requirement specifiers. VCS project urls. Local project directories.
Read more >
Release Notes — pip 10.0.0.dev0 documentation
BACKWARD INCOMPATIBLE Remove the attempted autodetection of requirement names from URLs, URLs must include a name via #egg= . DEPRECATION pip install --egg ......
Read more >
pip 1.2.1 - PyPI
pip is a tool for installing and managing Python packages, such as those ... Fixed issue #487 - upgrade from VCS url of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found