question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pylint in VSCode showing different output from running pylint in command line

See original GitHub issue

Environment data

VS Code version: 1.20.0 Python Extension version: 2018.1.0 Python Version: 2.7.10 OS and version: macOS High Sierra 10.13.3

Actual behavior

Errors being thrown by pylint in the extension differ greatly from those in the output of running pylint in the command line.

  • pylint in the command line uses current working environment to resolve imports from installed packages. Extension does not and is unable to import packages in the environment
  • pylint ignores print statements since installed python version is < 3. Extension throws errors at these statements

Most importantly, the extension was working FINE until the recent VSCode update

Expected behavior

Extension should follow be able to import packages installed in local environment, use local python version, have same output as pylint when run in command line and return to working as before

Steps to reproduce:

No clue

Logs

Output from Python output panel

##########Linting Output - pylint##########
************* Module pptgen.pptprocessor
7,0,error,E0401:Unable to import 'pptx'
8,0,error,E0401:Unable to import 'pptx.dml.color'
9,0,error,E0401:Unable to import 'pptx.util'
56,8,error,E1601:print statement used

------------------------------------------------------------------
Your code has been rated at 7.47/10 (previous run: 9.75/10, -2.28)

Output from Console window (Help->Developer Tools menu)

[Extension Host] Python Extension: Failed to get conda info from conda null
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:253

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
DonJayamannecommented, Feb 8, 2018
  • Please could you provide the value from python.pythonPath setting in your workspace setting?
  • Next, please copy the above settng into your terminal window xxxx/bin/python -m pylint <filename>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Linting Python in Visual Studio Code
To enable linters, open the Command Palette (Ctrl+Shift+P) and select the Python: Select Linter command. The Select Linter command adds "python.linting.<linter> ...
Read more >
python - VS Code has issues with Pylint - Stack Overflow
My output shows the pylint command and output, but somehow it is not running on the author environment. :/ – BarT. Nov 30,...
Read more >
Pylint output - Pylint 2.16.0-dev documentation
The simplest way to output to a file is with the --output=<filename> option. The default format for the output is raw text. You...
Read more >
Use PyLint for Python code - Visual Studio - Microsoft Learn
Í þessari grein. Run PyLint; Set PyLint command-line options. Applies to: yes Visual Studio no Visual Studio for Mac no Visual Studio Code....
Read more >
Linting Python in Visual Studio Code | by Yashshavi Kashyap
By default, linting for Python is enabled in Visual Studio Code using Pylint, and you can enable other linters of your choice.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found