Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh pip3 install -r requirements.txt fails with ImportError: cannot import name 'SourceDistribution' from 'pip._internal.distributions.source' #1353

Closed
dahorak opened this issue Jan 21, 2020 · 3 comments
Labels
High Priority High priority issues

Comments

@dahorak
Copy link
Contributor

dahorak commented Jan 21, 2020

Installation of requirements (pip3 install -r requirements.txt) in freshly created virtualenv fails with following traceback:

pip3 install -r requirements.txt
Traceback (most recent call last):
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/bin/pip3", line 11, in <module>
    sys.exit(main())
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib/python3.6/site-packages/pip/_internal/cli/main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib/python3.6/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
    module = importlib.import_module(module_path)
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 24, in <module>
    from pip._internal.cli.req_command import RequirementCommand
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 20, in <module>
    from pip._internal.operations.prepare import RequirementPreparer
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 16, in <module>
    from pip._internal.distributions import (
  File "/home/jenkins/workspace/qe-destroy-ocs-cluster/ocs-ci/.venv/lib/python3.6/site-packages/pip/_internal/distributions/__init__.py", line 1, in <module>
    from pip._internal.distributions.source import SourceDistribution
ImportError: cannot import name 'SourceDistribution'

Execution of that installation command in existing (previously installed) virtualenv works correctly.

@dahorak dahorak added the High Priority High priority issues label Jan 21, 2020
@dahorak
Copy link
Contributor Author

dahorak commented Jan 21, 2020

It seems to be related to the new pip release (version 20.0 was released 30 minutes ago: https://pypi.org/project/pip/#history).

@dahorak
Copy link
Contributor Author

dahorak commented Jan 21, 2020

There is already official issue: pypa/pip#7620

@petr-balogh
Copy link
Member

Closing as it was fixed just now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority High priority issues
Projects
None yet
Development

No branches or pull requests

2 participants