Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Troubleshooting jnpr.junos Import Errors

    Problem

    Description:

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

        from jnpr.junos import Device
    ImportError: No module named junos

    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@localhost ~]$ python
    >>> 
    >>> import jnpr.junos
    >>> jnpr.junos.__version__
    '1.0.0'
    

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

    Modified: 2016-07-28