Junos Automation (Scripting)
Highlighted
Junos Automation (Scripting)

'Console' object has no attribute '_use_filter' Junos-eznc

a week ago

when i run a simple code like that :

from jnpr.junos import Device
from jnpr.junos.op.routes import RouteTable

dev = Device(host='xxxx', user='demo', password='demo123', gather_facts=False)
dev.open()

tbl = RouteTable(dev)
tbl.get()
#tbl.get('10.13.10.0/23', protocol='static')
print tbl
for item in tbl:
print 'protocol:', item.protocol
print 'age:', item.age
print 'via:', item.via
print

dev.close()

 

it keeps getting this error : (AttributeError: 'Console' object has no attribute '_use_filter') in this file (\jnpr\junos\factory\table.py) as i didnt change anything inside the library.

 

it also didnt read the yaml file while importing (from jnpr.junos.op.routes import RouteTable)

 

Junos-eznc version :2.3.1

Jinja2 version :3.0.0a1

 

3 REPLIES 3
Highlighted
Junos Automation (Scripting)

Re: 'Console' object has no attribute '_use_filter' Junos-eznc

a week ago

Hi myehiaa,

 

The script works fine, I've checked on:

 

Python 2.7.14

PyYAML 5.1.1

Jinja2 2.10.1
junos-eznc 2.2.1

 

Try deleting some of this packages using "pip uninstall <pkg_name>" and re-install if that resolves.  If the YAML wasn't read, it's to do with versioning or you're missing one of the packages above.  Please keep us posted with your resolution.

 

Hope this helps.

Regards,
-r.

--------------------------------------------------

If this solves your problem, please mark this post as "Accepted Solution."
Kudos are always appreciated Smiley Happy.

Highlighted
Junos Automation (Scripting)

Re: 'Console' object has no attribute '_use_filter' Junos-eznc

a week ago

Hi Mriyaz,

 

After installing your versions :-

PyYAML 5.1.1

Jinja2 2.10.1
junos-eznc 2.2.1

the script starts to work ,

but is there a global problem with these versions ?

Junos-eznc version :2.3.1

Jinja2 version :3.0.0a1

Python:3.8

PYyaml: 5.3.1

 

Highlighted
Junos Automation (Scripting)
Solution
Accepted by topic author myehiaa
Wednesday

Re: 'Console' object has no attribute '_use_filter' Junos-eznc

Tuesday

Hello myehiaa,

 

There's an issue with installation of PyEZ dependencies with 3.8, perhaps because it's too new.  You can use Python 3.4 for now, thats working too.

 

Hope this helps.

Regards,
-r.

--------------------------------------------------

If this solves your problem, please mark this post as "Accepted Solution."
Kudos are always appreciated Smiley Happy.