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
{{ message }}
Repository navigation
E0401:Unable to import ... - pylint linting output #1185
Extension version (available under the Extensions sidebar): 2018.2.1
OS and version: macOS Sierra version 10.12.6
Python version (& distribution if applicable, e.g. Anaconda): Anaconda custom (64 bit) Python 3.6.4
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Relevant/affected Python packages and their versions:
Actual behavior
This program works fine from the command line. I wrote this using the Python extension approx. 6 months ago on another mac. I recently picked up this program again and it shows me the import errors as shown in the attached screenshot. I know that it is pylint related. I am also attaching my user settings and workspace settings screenshots
Expected behavior
It should not show errors for import
Steps to reproduce:
See the screenshorts
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
6,0,error,E0401:Unable to import 'vglabs_common'
7,0,error,E0401:Unable to import 'vglabs_anis'
8,0,error,E0401:Unable to import 'vglabs_brz'
10,0,error,E0401:Unable to import 'vglabs_inf'
11,0,error,E0401:Unable to import 'vglabs_mrp'
12,0,error,E0401:Unable to import 'vglabs_nmr'
13,0,error,E0401:Unable to import 'vglabs_op'
14,0,error,E0401:Unable to import 'vglabs_re'
15,0,error,E0401:Unable to import 'vglabs_ssk'
16,0,error,E0401:Unable to import 'vglabs_txc'
17,0,error,E0401:Unable to import 'vglabs_xrd'
##########Linting Output - pylint##########
No config file found, using default configuration
************* Module vglabs_uploader
6,0,error,E0401:Unable to import 'vglabs_common'
7,0,error,E0401:Unable to import 'vglabs_anis'
8,0,error,E0401:Unable to import 'vglabs_brz'
10,0,error,E0401:Unable to import 'vglabs_inf'
11,0,error,E0401:Unable to import 'vglabs_mrp'
12,0,error,E0401:Unable to import 'vglabs_nmr'
13,0,error,E0401:Unable to import 'vglabs_op'
14,0,error,E0401:Unable to import 'vglabs_re'
15,0,error,E0401:Unable to import 'vglabs_ssk'
16,0,error,E0401:Unable to import 'vglabs_txc'
17,0,error,E0401:Unable to import 'vglabs_xrd'
59,0,refactor,R0912:Too many branches (15/12)
107,0,refactor,R0912:Too many branches (15/12)
5,0,warning,W0611:Unused import psycopg2
XXX
Output from `Console` under the `Developer Tools` panel (toggle Developer Tools on under `Help`)
This is a common error that most people come across, please check stack overflow as per the issue template.
You have not installed pylint in the same environment that contains your python packages.
The environment selected in VS Code is displayed at the bottom left on the status bar of VS Code.
Again, please check stack over flow and the documentation on selecting an interpreter https://code.visualstudio.com/docs/python/environments#_choosing-an-environment
Hello Don, Thanks for your quick response. I did more work on this issues last night and it may not be a VSCode Python extension issue at all. Rather, it seems like a 'pylint' issue. I took out the VSCode environment from the equation and ran pylint from command line and got the same errors. Please see below:
bharat:~/py_work/vglabs_uploader
→ pylint vglabs_uploader.py
No config file found, using default configuration
************* Module vglabs_uploader
E: 6, 0: Unable to import 'vglabs_common' (import-error)
E: 7, 0: Unable to import 'vglabs_anis' (import-error)
E: 8, 0: Unable to import 'vglabs_brz' (import-error)
E: 10, 0: Unable to import 'vglabs_inf' (import-error)
E: 11, 0: Unable to import 'vglabs_mrp' (import-error)
E: 12, 0: Unable to import 'vglabs_nmr' (import-error)
E: 13, 0: Unable to import 'vglabs_op' (import-error)
E: 14, 0: Unable to import 'vglabs_re' (import-error)
E: 15, 0: Unable to import 'vglabs_ssk' (import-error)
E: 16, 0: Unable to import 'vglabs_txc' (import-error)
E: 17, 0: Unable to import 'vglabs_xrd' (import-error)
R: 59, 0: Too many branches (15/12) (too-many-branches)
R:107, 0: Too many branches (15/12) (too-many-branches)
Your code has been rated at 5.25/10 (previous run: 5.25/10, +0.00)
bharat:~/py_work/vglabs_uploader
→
Would you have any idea on how to configure pylint correctly? I am using Anaconda installer and there is just one conda environment. I tried installing and uninstalling pylint both using conda and pip, but the error does not go away.
Apologies for hasty posting, I should have done the command line test before posting here.
Activity
DonJayamanne commentedon Mar 25, 2018
This is a common error that most people come across, please check stack overflow as per the issue template.
You have not installed pylint in the same environment that contains your python packages.
The environment selected in VS Code is displayed at the bottom left on the status bar of VS Code.
Again, please check stack over flow and the documentation on selecting an interpreter https://code.visualstudio.com/docs/python/environments#_choosing-an-environment
bruparel commentedon Mar 25, 2018
Hello Don, Thanks for your quick response. I did more work on this issues last night and it may not be a VSCode Python extension issue at all. Rather, it seems like a 'pylint' issue. I took out the VSCode environment from the equation and ran pylint from command line and got the same errors. Please see below:
bharat:~/py_work/vglabs_uploader
→ pylint vglabs_uploader.py
No config file found, using default configuration
************* Module vglabs_uploader
E: 6, 0: Unable to import 'vglabs_common' (import-error)
E: 7, 0: Unable to import 'vglabs_anis' (import-error)
E: 8, 0: Unable to import 'vglabs_brz' (import-error)
E: 10, 0: Unable to import 'vglabs_inf' (import-error)
E: 11, 0: Unable to import 'vglabs_mrp' (import-error)
E: 12, 0: Unable to import 'vglabs_nmr' (import-error)
E: 13, 0: Unable to import 'vglabs_op' (import-error)
E: 14, 0: Unable to import 'vglabs_re' (import-error)
E: 15, 0: Unable to import 'vglabs_ssk' (import-error)
E: 16, 0: Unable to import 'vglabs_txc' (import-error)
E: 17, 0: Unable to import 'vglabs_xrd' (import-error)
R: 59, 0: Too many branches (15/12) (too-many-branches)
R:107, 0: Too many branches (15/12) (too-many-branches)
Your code has been rated at 5.25/10 (previous run: 5.25/10, +0.00)
bharat:~/py_work/vglabs_uploader
→
Would you have any idea on how to configure pylint correctly? I am using Anaconda installer and there is just one conda environment. I tried installing and uninstalling pylint both using conda and pip, but the error does not go away.
Apologies for hasty posting, I should have done the command line test before posting here.
DonJayamanne commentedon Mar 25, 2018
Please check their documentation or stack overflow.