Detection of flake8 is inconsitent/broken in some cases
See original GitHub issueEnvironment data
- VS Code version: 1.23.1
- Extension version (available under the Extensions sidebar): 2018.5.0
- OS and version: Ubuntu 16.04 (w/ latest updates)
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.5
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): pipenv/virtualenv
- Relevant/affected Python packages and their versions:
- pipenv, version 11.10.0
Actual behavior
“Linter Flake8 is not installed.” notification box pops up every time I try to save a Python file.
Expected behavior
Flake8 linting works for python file
Steps to reproduce:
pipenv --python 3.6 shell
code .
pipenv install flake8 --dev
- Open Python file in VS code, edit, save.
But, in the VS Code “Terminal” tab, I can do:
(tarsnap-prune-0dGG-SaN)rsyring@loftey:~/projects/tarsnap-prune$ pip freeze
flake8==3.5.0
mccabe==0.6.1
pycodestyle==2.3.1
pyflakes==1.6.0
sh==1.12.14
(tarsnap-prune-0dGG-SaN)rsyring@loftey:~/projects/tarsnap-prune$ python
Python 3.6.5 (default, Mar 29 2018, 03:28:50)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flake8
>>>
(tarsnap-prune-0dGG-SaN)rsyring@loftey:~/projects/tarsnap-prune$
I have other projects where flake8 linting works fine in vscode.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Starting the classic analysis engine.
Linter 'flake8' is not installed. Please install it or select another linter".
Error: Module 'flake8' not installed.
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
log.ts:159 INFO no standard startup: not using cached data
TMSyntax.ts:44 Overwriting grammar scope name to file mapping for scope source.jinja.
Old grammar file: /data/rsyring/.vscode/extensions/korekontrol.saltstack-0.0.5/syntaxes/jinja.json.
New grammar file: /data/rsyring/.vscode/extensions/wholroyd.jinja-0.0.8/syntaxes/jinja.json
e.register @ TMSyntax.ts:44
TMSyntax.ts:44 Overwriting grammar scope name to file mapping for scope text.yaml.jinja.
Old grammar file: /data/rsyring/.vscode/extensions/korekontrol.saltstack-0.0.5/syntaxes/sls.json.
New grammar file: /data/rsyring/.vscode/extensions/wholroyd.jinja-0.0.8/syntaxes/jinja-yaml.json
e.register @ TMSyntax.ts:44
webviewElement.ts:132 [Embedded Page] Blocked script execution in 'data:text/html;charset=utf-8,%3C%21DOCTYPE%20html%3E%0D%0A%3Chtml%20lang%3D%22en%22%20style%3D%22width%3A%20100%25%3B%20height%3A%20100%25%22%3E%0D%0A%3Chead%3E%0D%0A%09%3Ctitle%3EVirtual%20Document%3C%2Ftitle%3E%0D%0A%3C%2Fhead%3E%0D%0A%3Cbody%20style%3D%22margin%3A%200%3B%20overflow%3A%20hidden%3B%20width%3A%20100%25%3B%20height%3A%20100%25%22%3E%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
console.ts:136 [Extension Host] vscode-icons is active!
console.ts:136 [Extension Host] Python Extension: Linter 'flake8' is not installed. Please install it or select another linter". Error: Module 'flake8' not installed.
at PythonExecutionService.<anonymous> (/data/rsyring/.vscode/extensions/ms-python.python-2018.5.0/out/client/common/process/pythonProcess.js:96:27)
at Generator.next (<anonymous>)
at fulfilled (/data/rsyring/.vscode/extensions/ms-python.python-2018.5.0/out/client/common/process/pythonProcess.js:12:58)
at <anonymous>
t.log @ console.ts:136
notificationsAlerts.ts:42 Linter flake8 is not installed.
e.onDidNotificationChange @ notificationsAlerts.ts:42
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Detection of flake8 is inconsitent/broken in some cases #1892
Expected behavior. Flake8 linting works for python file. Steps to reproduce: pipenv --python 3.6 shell; code .
Read more >Error / Violation Codes — flake8 6.0.0 documentation
Most plugins will list their error codes in their documentation or README. ... 'from module import *' used; unable to detect undefined names....
Read more >flake8 Documentation - Read the Docs
If you only want to see the instances of a specific warning or error, you can select that error like so: flake8 --select...
Read more >Code linting with Flake8 - Zaleos Blog
Let's start from an easier case, imagine, we are starting a new Python project. The simplest version of a script that runs this...
Read more >How to use flake8 as unittest case? - python - Stack Overflow
Unit test should allow "ugly" code as you're only testing functionality. – ljmc. Jun 6 at 19:53. Add a comment ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well, I had deleted and reinstalled the virtualenv so I had to re-install flake8. Once I did so, I have:
And…amazingly?, I no longer have the problem with VS Code. I’m certain I tried that same workflow a couple times before I reported the issue and you can see in my terminal paste above that from inside VS Code, flake8 was installed. But…who knows, it’s working now. Sorry to waste your time. 😮/
Please could you provide the output from the following command in your terminal:
/data/tmp/virtualenvs/tarsnap-prune-src-eTYfY8x1/bin/python -m flake8 --version
Please confirm you have restarted VS Code after making the changes to the
settings.json
file.