-
Notifications
You must be signed in to change notification settings - Fork 60
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 ImportError: No module named jnpr.junos #5
Comments
are you using virtualenv. Try setting ansible_python_interpreter Looks like it’s not able to find python (where PyEZ might be installed) You might need to explicitly define where is python Using the variable “ansible_python_interpreter” In the inventory, it will look like that [all] [all:vars] |
Hi, Thanks for the quick reply. I am not using virtualenv and I have tried setting the ansible_python_interpreter, without any success. I have tried in the inventory, as mentioned above, as well as in the ansible.cfg file, but without any luck. |
@dgarros Can you please help. |
Hi @siegster Please can you check where is your python located with Also do you have this issue with all examples or with one specifically ? Thanks |
Getting the same error with any environment that includes the jnpr.junos module. Error occurs when running the playbooks as well:
Set the python interpreter:
|
is it working after you setup the python interpreter? |
Apologies, my comment was unclear as a result of order. The interpreter had been set when I got the error. Just now testing I'm testing jnpr.junos with the hello.py and it seems to be able to import jnpr.junos just fine. |
Running on Mac installed via pip:
|
Please try to define Not sure if Env variables works with Vagrant |
I'll test that later. This is definitely related to how ansible is interpreting pythonpath vs. system default. Could also be an issue with homebrew installed python. |
setting ansible_python_interpreter didn't seem to help. |
Vagrant wasn't the culprit at all. I'm sure it had something to do with having python installed twice. I had used homebrew to install pip, which installed it's own version of python. When I pip installed junos-eznc, it was installed with that version of python that was also in the path.
Eventually, I fixed it by using homebrew to uninstall pip, ansible, and anything python related. Then I used easy_install to install pip against the system version. Then I pip installed junos-eznc and ansible. Following that process, I was able to get it to work. The test case, well outside vagrant is just running the following:
|
Hi,
I am having an issue with the Ansible portion, where it complains about hte jnpr.junos module. However, when doing a test straight from Python, the module can be accessed properly:
The Juniper.junos module for Ansible is also currently installed:
This is on a Mac OS X installation, with the following versions installed:
Might just very well be configuration related, but the VMs come up properly, yet I just cannot use the Ansible modules as they are called from the Vagrant File/current roles. Any help would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: