You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VS Code version: 1.16.1
Python Extension version: 0.7.0
Python Version: 3.5.4
OS and version: Windows 10 Version 1703, Build 15063.608
Using --init-hook in the setting python.linting.pylintArgs does not yield the same result as it does when used on the command line or in an rcfile. This may have something to do with the escaped \" character being used.
##########Linting Output - pylint##########
************* Module main
2,0,error,E0401:Unable to import 'requests'
----------------------------------------------------------------------
Your code has been rated at -15.00/10 (previous run: -15.00/10, +0.00)
Expected behavior
When using a .pylintrc file located in the top level directory containing this line:
I get no import errors, as expected. This also goes for when pylint is run straight from the terminal:
E:\Documents\Python Projects\test-pylint>pylint main.py --init-hook="import sys; sys.path.insert(0, 'E:/Documents/Python Projects/test-pylint/lib')"
----------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: -15.00/10, +25.00)
Steps to reproduce:
Use "--init-hook=\"import sys; sys.path.insert(0, 'path/to/lib')\"" in the python.linting.pylintArgs setting, see if modules in path/to/lib can be imported
Include the argument in an rcfile or command line argument instead, and see if it yields the same result
Copied from original issue: DonJayamanne/pythonVSCode#1215
The text was updated successfully, but these errors were encountered:
From @Tobotimus on September 18, 2017 1:46
Environment data
VS Code version: 1.16.1
Python Extension version: 0.7.0
Python Version: 3.5.4
OS and version: Windows 10 Version 1703, Build 15063.608
Using
--init-hook
in the settingpython.linting.pylintArgs
does not yield the same result as it does when used on the command line or in an rcfile. This may have something to do with the escaped\"
character being used.Here is an example. This is my module
main.py
:This is my file structure, located at
E:/Documents/Python Projects/test-pylint
:Actual behavior
When using the following settings in
.vscode/settings.json
, pylint is unable to import requests:From the Python output console:
Expected behavior
When using a
.pylintrc
file located in the top level directory containing this line:I get no import errors, as expected. This also goes for when pylint is run straight from the terminal:
Steps to reproduce:
"--init-hook=\"import sys; sys.path.insert(0, 'path/to/lib')\""
in thepython.linting.pylintArgs
setting, see if modules inpath/to/lib
can be importedCopied from original issue: DonJayamanne/pythonVSCode#1215
The text was updated successfully, but these errors were encountered: