Running the latest VsCode under Windows 10, I have installed wxPython from a terminal window into the Python 3.6.3 standard environment (the one it mentions when I ask python -V).
Within VsCode, provided I select that environment (Python 3.6.3 32-bit), my application runs fine.
However, if I switch to either of my other two environments, Python 3.6.6 64-bit or Python 3.7.2 32-bit, the import wx fails, presumably because I haven't pip install-ed wxPython into those environments.
How do I do this, pip install a package into a specific environment configured in VsCode?
I see that, when VsCode runs my application, it does something like:
cd 'c:\Users\Pax\Documents\pysrc';
${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; &
'C:\Users\Pax\AppData\Local\Programs\Python\Python36-32\python.exe'
'c:\Users\Pax\.vscode\extensions\blah\blah\ptvsd_launcher.py'
'--default' '--client' '--host' 'localhost' '--port' '53664'
'-m' 'myapp.py'
Do I need to do something similarly opaque when running pip?
condaor directly create it using VsCode?wxPythoninto corresponding environment bypython -m pip install wxPython.pipfor the environment. It appears from testing that running the specificpythonto run the specificpipalso works so, if you'd like to post that as an answer, it's worth some rep.