Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible playbook: ModuleNotFoundError: No module named 'jnpr' #47

Open
amrishpat opened this issue Apr 5, 2024 · 0 comments
Open

Ansible playbook: ModuleNotFoundError: No module named 'jnpr' #47

amrishpat opened this issue Apr 5, 2024 · 0 comments

Comments

@amrishpat
Copy link

Hello,

I am getting error message "ModuleNotFoundError: No module named 'jnpr'". I am able to run first task to check the NETCONF connectivity to the lab device.

This how my environment is setup: Windows11-wsl2:Ubuntu20.04, python3.8-full Virtual environment, within this venv installed ansible, Junos-pync, Jxmlease, xmltodict.

(myansible) student@DESKTOP-VF2VLG4:~$ ansible-playbook -i configuration/hosts Interface_desc_update.yml

PLAY [Load and commit Junos configurations] ****************************************************************************************************************

TASK [Verify NETCONF connectivity] *************************************************************************************************************************
ok: [xxx.xxx.xxx.xxx]

TASK [Load and commit the configurations] ******************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'jnpr'
fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File "/home/student/.ansible/tmp/ansible-tmp-1712339458.1710489-1769-257087027421743/AnsiballZ_config.py", line 107, in \n _ansiballz_main()\n File "/home/student/.ansible/tmp/ansible-tmp-1712339458.1710489-1769-257087027421743/AnsiballZ_config.py", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/student/.ansible/tmp/ansible-tmp-1712339458.1710489-1769-257087027421743/AnsiballZ_config.py", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.juniper.device.plugins.modules.config', init_globals=dict(_module_fqn='ansible_collections.juniper.device.plugins.modules.config', _modlib_path=modlib_path),\n File "/usr/lib/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code\n run_code(code, mod_globals, init_globals,\n File "/usr/lib/python3.8/runpy.py", line 87, in run_code\n exec(code, run_globals)\n File "/tmp/ansible_juniper.device.config_payload_vpwou34/ansible_juniper.device.config_payload.zip/ansible_collections/juniper/device/plugins/modules/config.py", line 828, in \n File "", line 259, in load_module\n File "/tmp/ansible_juniper.device.config_payload_vpwou34/ansible_juniper.device.config_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 42, in \nModuleNotFoundError: No module named 'jnpr'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *************************************************************************************************************************************************
xxx.xxx.xxx.xxx : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

(myansible) student@DESKTOP-VF2VLG4:~$ python3
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import jnpr.junos
jnpr.junos.version
'2.7.0'

Thank you in advance for looking into this.

Amrish Patel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant