visual studio code python how to get source code of import module definitian

Viewed 1463

im debugging python source code using windows WSL some modules that i import i can see the source and some i can't , why i can't ?

here i try to find out where is the module installed in WSL:

[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ansible
>>> ansible.__file__
'/home/boo/projects/ansible/lib/ansible/__init__.py'
>>> import site; site.getsitepackages()
['/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.8/dist-packages']
>>> cd
KeyboardInterrupt
>>>      

here i can see that i can't access :
enter image description here
here i can see that i can access :
enter image description here

i checked if the python that VSCODE is using the same as the one installed
enter image description here

and then i checked in the WSL : point to : python3 -> python3.8

tst@TEST:~/.local/lib/python3.8/site-packages/ansible/cli$  /bin/python3.8
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ansible
>>> ansible.__file__
'/home/tst/.local/lib/python3.8/site-packages/ansible/__init__.py'

SOLUTION: set :

justMyCode:false 

in launch.json

1 Answers

Thanks! More complete answer for those searching: make sure you have a launch.json file inside your .vscode folder -- you can create one automatically with these instructions: https://code.visualstudio.com/docs/python/debugging ... then add "justMyCode": false, inside that file.

Related