DistributionNotFound
2019-04-25 18:33:35.793928 | TASK [tripleo-repos : pip install tripleo-repos]
2019-04-25 18:33:36.275720 | primary | ERROR
2019-04-25 18:33:36.276103 | primary | {
2019-04-25 18:33:36.276171 | primary | "msg": "\n:stderr: Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 583, in _build_master\n ws.require(__requires__)\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 900, in require\n needed = self.resolve(parse_requirements(requirements))\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 791, in resolve\n raise VersionConflict(dist, req).with_context(dependent_req)\npkg_resources.VersionConflict: (virtualenv 16.5.0 (/usr/local/lib/python3.6/site-packages), Requirement.parse('virtualenv==16.0.0'))\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/bin/virtualenv-3\", line 6, in <module>\n from pkg_resources import load_entry_point\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 3241, in <module>\n @_call_aside\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 3225, in _call_aside\n f(*args, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 3254, in _initialize_master_working_set\n working_set = WorkingSet._build_master()\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 585, in _build_master\n return cls._build_from_requirements(__requires__)\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 598, in _build_from_requirements\n dists = ws.resolve(reqs, Environment())\n File \"/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 786, in resolve\n raise DistributionNotFound(req, requirers)\npkg_resources.DistributionNotFound: The 'virtualenv==16.0.0' distribution was not found and is required by the application\n"
http://logs.rdoproject.org/openstack-periodic-master/opendev.org/openstack/tripleo-
ci/master/periodic-tripleo-fedora-28-master-containers-build-push/69d4144/job-output.txt.gz
With help from jpena I was able to identify the root cause of that issue: the fedora-28 image used by rdo zool is broken:
$ virtualenv-3 --help lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 583, in _build_master require( __requires_ _) lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 900, in require parse_requireme nts(requirement s)) lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 791, in resolve (dist, req).with_ context( dependent_ req) VersionConflict : (virtualenv 16.5.0 (/usr/local/ lib/python3. 6/site- packages) , Requirement. parse(' virtualenv= =16.0.0' ))
Traceback (most recent call last):
File "/usr/local/
ws.
File "/usr/local/
needed = self.resolve(
File "/usr/local/
raise VersionConflict
pkg_resources.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): virtualenv- 3", line 6, in <module> lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 3241, in <module> lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 3225, in _call_aside lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 3254, in _initialize_ master_ working_ set _build_ master( ) lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 585, in _build_master from_requiremen ts(__requires_ _) lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 598, in _build_ from_requiremen ts lib/python3. 6/site- packages/ pkg_resources/ __init_ _.py", line 786, in resolve Found(req, requirers) DistributionNot Found: The 'virtualenv= =16.0.0' distribution was not found and is required by the application
File "/usr/bin/
from pkg_resources import load_entry_point
File "/usr/local/
@_call_aside
File "/usr/local/
f(*args, **kwargs)
File "/usr/local/
working_set = WorkingSet.
File "/usr/local/
return cls._build_
File "/usr/local/
dists = ws.resolve(reqs, Environment())
File "/usr/local/
raise DistributionNot
pkg_resources.
This was caused by installation of a newer version pip as root from pypi, one that overriden the system version and also broke virtualenv.
Similar example https:/ /github. com/certbot/ certbot/ issues/ 3730
This can only be fixed by fixing the image and avoiding to mess the operating system.
PS. If desired, wewer version of pip can safely be installed using `--user`, to avoid messing with the operating system one. If pip and other packages are installed at user level (zuul? root?) it should be safe.