I still have problems trying to fix Visual Studio Code configuration for Windows.
Proposed steps:
1º - Open Slicer Python Interector and install pylint, rope and autopep8:
slicer.util.pip_install(“pylint rope autopep8”)
2º - Open Visual Studio Code settings.json (located in C:\Users"user"\AppData\Roaming\Code\User)
3º - Items to add:
{
“python.pythonpath”: “C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\bin\SlicerPython.exe”,
“python.linting.pylintPath”: “C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\Python\Lib\site-packages\pylint\”,
“python.formatting.autopep8Path”: “C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\Python\Scripts\autopep8.exe”,
“python.autoComplete.extraPaths”: [
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\”,
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\Python\”,
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\QtPlugins\”,
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\Slicer-4.11\”,
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\bin\”,
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\Python\Lib\site-packages\”,
“C:\Users\user\AppData\Local\NA-MIC\Slicer 4.11.0-2019-12-02\lib\Python\Scripts\”,
],
“python.linting.enabled”: true,
“git.autofetch”: true
}
Now I have no errors in VSC but autocomplete is not working.
I´ve tried @Alex_Vergara code but VSCode throws error in import libraries and others…
I have no clear idea of which are the right directies of Slicer we need to add to extraPaths nor there is any difference between pythonpath “SlicerPython” or “PythonSlicer.exe”.
If this issue is fixed, muybe it should be added to documentation …
Thanks to all