Closed asottile closed 3 years ago
In GitLab by @sigmavirus24 on Oct 21, 2014, 08:13
So I can reproduce this with the following steps:
$ mkvirtualenv --version
1.11.6
$ mktmpenv
$ pip install flake8 hacking
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ flake8 get-pip.py
Traceback (most recent call last):
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/bin/flake8", line 9, in <module>
load_entry_point('flake8==2.2.5', 'console_scripts', 'flake8')()
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/flake8/main.py", line 24, in main
flake8_style = get_style_guide(parse_argv=True, config_file=DEFAULT_CONFIG)
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/flake8/engine.py", line 102, in get_style_guide
kwargs['parser'], options_hooks = get_parser()
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/flake8/engine.py", line 55, in get_parser
(extensions, parser_hooks, options_hooks) = _register_extensions()
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/flake8/engine.py", line 28, in _register_extensions
checker = entry.load()
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/pkg_resources.py", line 2145, in load
if require: self.require(env, installer)
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/pkg_resources.py", line 2159, in require
items = working_set.resolve(reqs, env, installer)
File "/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages/pkg_resources.py", line 643, in resolve
raise VersionConflict(dist, req) # XXX put more info here
pkg_resources.VersionConflict: (pep8 1.5.7 (/Users/ian7708/virtualenv/tmp-362ac240fd778619/lib/python2.7/site-packages), Requirement.parse('pep8==1.5.6'))
$ python -c 'import setuptools; print(setuptools.__version__)'
3.6
$ pip install -U setuptools
$ flake8 get-pip.py
# same traceback
$ pip install -U --force-reinstall hacking
Downloading/unpacking hacking
Downloading hacking-0.9.2-py2-none-any.whl
Downloading/unpacking pbr>=0.6,!=0.7,<1.0 (from hacking)
Downloading pbr-0.10.0-py2.py3-none-any.whl (63kB): 63kB downloaded
Downloading/unpacking flake8==2.1.0 (from hacking)
Downloading flake8-2.1.0.tar.gz
Running setup.py (path:/Users/ian7708/virtualenv/tmp-362ac240fd778619/build/flake8/setup.py) egg_info for package flake8
Downloading/unpacking pyflakes==0.8.1 (from hacking)
Downloading pyflakes-0.8.1-py2.py3-none-any.whl
Downloading/unpacking pep8==1.5.6 (from hacking)
Downloading pep8-1.5.6-py2.py3-none-any.whl
Downloading/unpacking six>=1.6.0 (from hacking)
Downloading six-1.8.0-py2.py3-none-any.whl
Downloading/unpacking pip (from pbr>=0.6,!=0.7,<1.0->hacking)
Downloading pip-1.5.6-py2.py3-none-any.whl (1.0MB): 1.0MB downloaded
Downloading/unpacking mccabe>=0.2.1 (from flake8==2.1.0->hacking)
Downloading mccabe-0.2.1.tar.gz
Running setup.py (path:/Users/ian7708/virtualenv/tmp-362ac240fd778619/build/mccabe/setup.py) egg_info for package mccabe
Installing collected packages: hacking, pbr, flake8, pyflakes, pep8, six, pip, mccabe
Found existing installation: hacking 0.9.2
Uninstalling hacking:
Successfully uninstalled hacking
Found existing installation: pbr 0.10.0
Uninstalling pbr:
Successfully uninstalled pbr
Found existing installation: flake8 2.2.5
Uninstalling flake8:
Successfully uninstalled flake8
Running setup.py install for flake8
Installing flake8 script to /Users/ian7708/virtualenv/tmp-362ac240fd778619/bin
Found existing installation: pyflakes 0.8.1
Uninstalling pyflakes:
Successfully uninstalled pyflakes
Found existing installation: pep8 1.5.7
Uninstalling pep8:
Successfully uninstalled pep8
Found existing installation: six 1.8.0
Uninstalling six:
Successfully uninstalled six
Found existing installation: pip 1.5.6
Uninstalling pip:
Successfully uninstalled pip
Found existing installation: mccabe 0.2.1
Uninstalling mccabe:
Successfully uninstalled mccabe
Running setup.py install for mccabe
Successfully installed hacking pbr flake8 pyflakes pep8 six pip mccabe
Cleaning up...
$ flake8 get-pip.py
get-pip.py:17420:13: F401 'setuptools' imported but unused
In GitLab by @sigmavirus24 on Oct 21, 2014, 08:18
When I first install flake8
and hacking
together I see:
pip install flake8 hacking
Downloading/unpacking flake8
Downloading flake8-2.2.5.tar.gz
Running setup.py (path:/Users/ian7708/virtualenv/tmp-362ac240fd778619/build/flake8/setup.py) egg_info for package flake8
Downloading/unpacking hacking
Downloading hacking-0.9.2-py2-none-any.whl
Downloading/unpacking pyflakes>=0.8.1 (from flake8)
Downloading pyflakes-0.8.1-py2.py3-none-any.whl
Downloading/unpacking pep8>=1.5.7 (from flake8)
Downloading pep8-1.5.7-py2.py3-none-any.whl
Downloading/unpacking mccabe>=0.2.1 (from flake8)
Downloading mccabe-0.2.1.tar.gz
Running setup.py (path:/Users/ian7708/virtualenv/tmp-362ac240fd778619/build/mccabe/setup.py) egg_info for package mccabe
Downloading/unpacking pbr>=0.6,!=0.7,<1.0 (from hacking)
Downloading pbr-0.10.0-py2.py3-none-any.whl (63kB): 63kB downloaded
Downloading/unpacking six>=1.6.0 (from hacking)
Downloading six-1.8.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pip in ./lib/python2.7/site-packages (from pbr>=0.6,!=0.7,<1.0->hacking)
Installing collected packages: flake8, hacking, pyflakes, pep8, mccabe, pbr, six
Running setup.py install for flake8
Installing flake8 script to /Users/ian7708/virtualenv/tmp-362ac240fd778619/bin
Running setup.py install for mccabe
Successfully installed flake8 hacking pyflakes pep8 mccabe pbr six
Cleaning up...
I'm setting up a new env to see what happens if I uninstall hacking/pbr after receiving the error. The stack trace points to the extension loading code and I'll have to debug into that to see which extension it's failing to load (I suspect, hacking)
In GitLab by @sigmavirus24 on Oct 21, 2014, 08:25
This still happens even if you upgrade to setuptools 7.0 after making a clean tmp environment.
In GitLab by @sigmavirus24 on Oct 21, 2014, 08:27
If you then do pip uninstall -y pbr hacking six
flake8 works fine. Since I already tested installing flake8 first and then hacking and found no problems, this seems to be an issue with how hacking is installed.
In GitLab by @sigmavirus24 on Oct 21, 2014, 14:25
This is an unfortunate combination of version pinning and some part of the dependency checking failing. It's not a bug here. If you're using hacking, you should only be using pip install hacking
to ensure that you get the appropriate versions of flake8, pep8, etc
In GitLab by @dolphm on Oct 21, 2014, 06:09
I'm hoping this is a bug in setuptools or something, but I'm stumped. I've nuked my Python install on OS X (using homebrew), re-installed pip, setuptools, flake8, and pep8 from scratch (using brew-installed pip), and this is easily reproduced. It's been ongoing for over a week, perhaps since the release of https://pypi.python.org/pypi/setuptools/6.1 which has a related fix https://bitbucket.org/pypa/setuptools/issue/268 -- but reverting to setuptools 6.0.2 does not resolve the issue (also tried a much older setuptools==5.8 without success).
To reproduce (on my system, anyway):
And the subsequent error:
(pep8==1.5.6 is required by WHAT?!)
The only workaround I can find is installing flake8==2.1.0 and pep8==1.5.6 (shown below):
This combo works:
For funsies: