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:
- Created 5 years ago
- Reactions:17
- Comments:30 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 asource_dir
set to something other thanNone
. 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. 😕