setuptools: AttributeError: Distribution instance has no attribute 'install_requires'
When downgrading setuptools 36.2.0 to 36.1.1 I get the above error. Here’s a log output:
2017-07-14 06:03:13.445605 | Installing collected packages: setuptools, pyldap, ldappool, pytz, Babel, MarkupSafe, Jinja2, olefile, Pillow, PyYAML, Pygments, alabaster, six, docutils, sphinx-rtd-theme, snowballstemmer, Sphinx, pbr, bashate, bottle, pycparser, cffi, chardet, coverage, ipaddress, pyasn1, enum34, idna, cryptography, restructuredtext-lint, stevedore, doc8, dulwich, funcsigs, mock, openstackdocstheme, requests, oslosphinx, paramiko, pycrypto, reno, sphinxmark, virtualenv, pyflakes, mccabe, pep8, flake8, hacking, ansible, ansible-lint
2017-07-14 06:03:13.445996 | Found existing installation: setuptools 36.2.0
2017-07-14 06:03:13.486541 | Uninstalling setuptools-36.2.0:
2017-07-14 06:03:13.504098 | Successfully uninstalled setuptools-36.2.0
2017-07-14 06:03:13.510070 | Rolling back uninstall of setuptools
2017-07-14 06:03:13.702180 | Exception:
2017-07-14 06:03:13.702251 | Traceback (most recent call last):
2017-07-14 06:03:13.702314 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
2017-07-14 06:03:13.702339 | status = self.run(options, args)
2017-07-14 06:03:13.702398 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
2017-07-14 06:03:13.702421 | prefix=options.prefix_path,
2017-07-14 06:03:13.702480 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
2017-07-14 06:03:13.702496 | **kwargs
2017-07-14 06:03:13.702556 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
2017-07-14 06:03:13.702588 | self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
2017-07-14 06:03:13.702650 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
2017-07-14 06:03:13.702672 | isolated=self.isolated,
2017-07-14 06:03:13.702732 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/wheel.py", line 247, in move_wheel_files
2017-07-14 06:03:13.702750 | prefix=prefix,
2017-07-14 06:03:13.702810 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/pip/locations.py", line 140, in distutils_scheme
2017-07-14 06:03:13.702833 | d = Distribution(dist_args)
2017-07-14 06:03:13.702892 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/setuptools/dist.py", line 365, in __init__
2017-07-14 06:03:13.702913 | self._finalize_requires()
2017-07-14 06:03:13.702974 | File "/home/jenkins/workspace/gate-openstack-ansible-linters-ubuntu-xenial/.tox/linters/local/lib/python2.7/site-packages/setuptools/dist.py", line 372, in _finalize_requires
2017-07-14 06:03:13.702996 | if not self.install_requires:
2017-07-14 06:03:13.703029 | AttributeError: Distribution instance has no attribute 'install_requires'
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 15 (7 by maintainers)
Commits related to this issue
- Update setuptools to 36.2.0 Due to [1] the downgrade of setuptools is not possible, so this patch is updating setuptools to the current version as a stop-gap until a fix is released. [1] https://git... — committed to openstack/openstack-ansible by deleted user 7 years ago
- Update setuptools to 36.2.0 Due to [1] the downgrade of setuptools is not possible, so this patch is updating setuptools to the current version as a stop-gap until a fix is released. [1] https://git... — committed to openstack/openstack-ansible by deleted user 7 years ago
- Updated openstack/openstack Project: openstack/requirements 379a1e66a751988fd178aaf1b810b91070abc97f Blacklist setuptools 36.2.0 Setuptools 36.2.0 assumes that install_requires is always defined, w... — committed to openstack/openstack by deleted user 7 years ago
- Blacklist setuptools 36.2.0 Setuptools 36.2.0 assumes that install_requires is always defined, which it is not. See the details in [1] and [2], with the ML notification [3]. [1] https://github.com/p... — committed to openstack/requirements by deleted user 7 years ago
- Updated openstack/openstack Project: openstack/requirements 379a1e66a751988fd178aaf1b810b91070abc97f Blacklist setuptools 36.2.0 Setuptools 36.2.0 assumes that install_requires is always defined, w... — committed to openstack/openstack by deleted user 7 years ago
- Blacklist setuptools 36.2.0 Setuptools 36.2.0 assumes that install_requires is always defined, which it is not. See the details in [1] and [2], with the ML notification [3]. [1] https://github.com/p... — committed to openstack/requirements by deleted user 7 years ago
- Blacklist setuptools 36.2.0 Setuptools 36.2.0 assumes that install_requires is always defined, which it is not. See the details in [1] and [2], with the ML notification [3]. [1] https://github.com/p... — committed to openstack/requirements by deleted user 7 years ago
- Remove ceph_client role execution from playbooks The ceph_client role is now executed inside the nova, cinder, and glance roles as an include_role statement to avoid service restart and library link... — committed to openstack/openstack-ansible by logan2211 7 years ago
- Fix Travis build problem Caused by us requiring an older setuptools, together with a setuptools downgrading issue: https://github.com/pypa/setuptools/issues/1086 In this change we actually upgrade *... — committed to walles/px by walles 7 years ago
- MNT: Manually upgrade setuptools Works around pypa/setuptools#1086 and pypa/setuptools#1101 — committed to dopplershift/siphon by dopplershift 7 years ago
- travis.yml: work around pypa/setuptools#1086 The python3.6 archive from travis contains setuptools 36.2.0 which breaks if additional packages are installed when setuptools is upgraded. Work around th... — committed to Emantor/labgrid by Emantor 7 years ago
- Merge pull request #119 from Emantor/fix/travis_setuptools travis.yml: work around pypa/setuptools#1086 — committed to labgrid-project/labgrid by jluebbe 7 years ago
- trying to fix setuptools related issue, see pypa/setuptools#1086 — committed to moltob/pymultigen by moltob 7 years ago
- Fix CI (https://github.com/pypa/setuptools/issues/1086) — committed to ticketscloud/yadm by zzzsochi 7 years ago
- Workaround pypa/setuptools#1086. — committed to anntzer/ipython-autoimport by anntzer 7 years ago
- Workaround pypa/setuptools#1086. — committed to anntzer/ipython-autoimport by anntzer 7 years ago
- fix: cornercase ci fail https://github.com/pypa/setuptools/issues/1086 — committed to DD-DeCaF/GECKO by hredestig 7 years ago
- fix: cornercase ci fail https://github.com/pypa/setuptools/issues/1086 — committed to DD-DeCaF/GECKO by hredestig 7 years ago
- travis: Do not try to upgrade setuptools To work around pypa/setuptools#1086. — committed to mitya57/sphinxcontrib-websupport by mitya57 7 years ago
This checks out. A minimum reproducible test case had a requirements.txt file of just setuptools==36.5.0 and pylint==1.7.2. Looks like pylint is compiling wrapt in the installation, which is sufficient to trigger this bug.
Added a new line to my
.travis.yml
file topip install setuptools==36.5.0
beforepip install -r requirements.txt
solved the problem for me, just in case anyone else hits the same issue.Is this issue supposed to be fixed? Still experiencing the error when building on Travis CI. Or is there something wrong on their side?
OK, I’ve confirmed that if doing both an install of something from a git source and downgrading setuptools at the same time causes the failure.
@mimischi, @marius92mc: there’s no way to know if you’re experiencing the same issue with the limited information you provide. As noted above, the problem should only occur when a package is built from source and setuptools is also downgraded/upgraded from 36.2.0 as part of the same
pip install
invocation. The workaround is to downgrade/update setuptools by itself from wheel.