Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos PyEZ Developer Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Troubleshoot jnpr.junos Import Errors

date_range 19-Aug-22

Problem

Description

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

content_copy zoom_out_map
    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 Junos devices.

Solution

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

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

content_copy zoom_out_map
[user@server ~]$ python
>>> import jnpr.junos
>>> jnpr.junos.__version__
'2.2.0'

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

footer-navigation