SublimeLinter / SublimeLinter-flake8

SublimeLinter plugin for python, using flake8.
MIT License
184 stars 28 forks source link

recent update triggers ImportError of configparser module #102

Closed aphearin closed 5 years ago

aphearin commented 6 years ago

A recent update of sublime seems to have caused a problem for my flake8 plugin configuration. I am not sure which update caused this behavior, but it must have been within the past few days. When viewing python modules with SublimeLinter turned on, I now get the following error message:

SublimeLinter: #1 flake8 setup.py ERROR:
========================================
Traceback (most recent call last):
  File "/Users/aphearin/anaconda/bin/flake8", line 11, in <module>
    load_entry_point('flake8==3.5.0', 'console_scripts', 'flake8')()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/aphearin/anaconda/lib/python2.7/site-packages/flake8/main/cli.py", line 2, in <module>
    from flake8.main import application
  File "/Users/aphearin/anaconda/lib/python2.7/site-packages/flake8/main/application.py", line 14, in <module>
    from flake8.main import options
  File "/Users/aphearin/anaconda/lib/python2.7/site-packages/flake8/main/options.py", line 4, in <module>
    from flake8.main import vcs
  File "/Users/aphearin/anaconda/lib/python2.7/site-packages/flake8/main/vcs.py", line 4, in <module>
    from flake8.main import mercurial
  File "/Users/aphearin/anaconda/lib/python2.7/site-packages/flake8/main/mercurial.py", line 7, in <module>
    import configparser
ImportError: No module named configparser
kaste commented 6 years ago

The only thing we changed here afaik is that we now show such errors. Before we only logged them to the Sublime console.

So I think it didn't work before but you never noticed. 🤔

aphearin commented 6 years ago

Ok, then maybe this is innocuous. Is it easy to change the display settings to hide this error message?

kaste commented 6 years ago

Hm, 'innocuous'. I think when you see such an error, the linting doesn't work, so you either fix that. (E.g. import configparser indicates that you run the python3 flake8, it errs bc you run in a python27 environment which doesn't have configparser (but ConfigParser LOL)).

If you don't want to fix it (right now), it is better to just disable the plugin/linter per project or globally, bc always trying to run flake8 just eats cpu cycles.

kaste commented 5 years ago

Closing due to age