/usr/local/bin/python3.7 “/Users/cmoullia/Library/Application Support/JetBrains/IntelliJIdea2020.1/plugins/python/helpers/pydev/pydevd.py” --multiproc --qt-support=auto --client 127.0.0.1 --port 57135 --file /Users/cmoullia/code/ansible/community.kubernetes/plugins/modules/k8s_log.py
pydev debugger: process 68087 is connecting
Connected to pydev debugger (build 201.8538.31)
Traceback (most recent call last):
File “”, line 983, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
ModuleNotFoundError: No module named ‘ansible_collections’
That fails if I try what you suggest as the project (I suppose) is no installed as a collection but git cloned
(.venv) ~/code/ansible/ansible_collections $ PYTHONPATH=/Users/cmoullia/code/ansible/ansible_collections python3 community/kubernetes/plugins/modules/k8s_log.py
Traceback (most recent call last):
File “community/kubernetes/plugins/modules/k8s_log.py”, line 131, in
from ansible_collections.community.kubernetes.plugins.module_utils.common import KubernetesAnsibleModule
ModuleNotFoundError: No module named ‘ansible_collections’
ansible_collections is the python module that the code will try to load, so you cannot contain that in your PYTHONPATH, you need to set your PYTHONPATH to the directory that contains the ansible_collections directory.
fwiw, I wouldn’t recommend using this as the primary means to test or debug a module.
Sorry but I don’t see how I could debug the code with a breakpoint declared within my IDEA tool using this command “ansible localhost -m ping -a ‘data=debugging_session’ -vvv” …