Code Monkey home page Code Monkey logo

Comments (5)

asottile avatar asottile commented on May 26, 2024

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

from flake8.

asottile avatar asottile commented on May 26, 2024

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)

from flake8.

asottile avatar asottile commented on May 26, 2024

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.

from flake8.

asottile avatar asottile commented on May 26, 2024

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.

from flake8.

asottile avatar asottile commented on May 26, 2024

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

from flake8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.