Troubleshooting jnpr.junos Import Errors

 

Problem

Description:

Python generates an error message that the jnpr.junos module was not found. For example:

Cause

The Juniper Networks Junos PyEZ Python library must be installed before importing the package and using it to perform operations on devices running Junos OS.

Solution

Install Junos PyEZ on the configuration management server and update any necessary environment variables. For installation instructions, see Installing Junos PyEZ.

To verify that Junos PyEZ is successfully installed, start Python and import the jnpr.junos package.

[user@server ~]$ python

If the jnpr.junos package is successfully imported and there is no error message, then Junos PyEZ is correctly installed.