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
Path translation when using WSL bash in integrated terminal #40
@echo off
set v_params=%*
set v_params=%v_params:\=/%
set v_params=%v_params:c:=/mnt/c%
set v_params=%v_params:"=\"%
bash.exe -c "python3 %v_params%"
Changed settings.json to use cmd as the integrated terminal and point the path to the bat script "python.pythonPath": "C:\\path\\to\\bat\\python3"
VSC finally able to Run Python File in Terminal but still warn me about to Select Python Environment
Based off above script, I created another one for pycodestyle and attempt to change "python.linting.pep8Path": "C:\\path\\to\bat\\pycodestyle" which should point to the pycodestyle installed on WSL bash but I ran into linting error as follow:
Output from Python output panel
----------Generating Tags----------
ctags --options=C:\Users\Liang\.vscode\extensions\ms-python.python-0.8.0\resources\ctagOptions --languages=Python --exclude=**/site-packages/** -o c:\code\.vscode\tags .
Linting with pep8 failed.
You could either install the 'pep8' linter or turn it off in setings.json via "python.linting.pep8Enabled = false".
Error: spawn pycodestyle ENOENT
From Troubleshooting linting, I can confirm pythonPath setting is correct since the python3.bat script executed without error and the linter was already installed under the current python3 environment in WSL bash.
However, if I installed pycodestyle via Windows pip, pep 8 linting runs just as expected.
Activity
ricek commentedon Nov 11, 2017
I was able to use a bat script to work around
python3.batChanged
settings.jsonto usecmdas the integrated terminal and point the path to the bat script"python.pythonPath": "C:\\path\\to\\bat\\python3"VSC finally able to Run Python File in Terminal but still warn me about to Select Python Environment
Based off above script, I created another one for
pycodestyleand attempt to change"python.linting.pep8Path": "C:\\path\\to\bat\\pycodestyle"which should point to thepycodestyleinstalled on WSL bash but I ran into linting error as follow:Output from
Pythonoutput panelFrom Troubleshooting linting, I can confirm
pythonPathsetting is correct since thepython3.batscript executed without error and the linter was already installed under the current python3 environment in WSL bash.However, if I installed
pycodestylevia Windows pip, pep 8 linting runs just as expected.helioascorreia commentedon Nov 12, 2017
It would be awesome to have support for wsl on python
brettcannon commentedon Nov 14, 2017
Closing as a duplicate of #67
liusanye commentedon Feb 16, 2018
How to make vscode debug call wsl python
DonJayamanne commentedon Feb 16, 2018
liusanye (@liusanye) please check #67 (this is not yet supported)