Junos Automation (Scripting)
Highlighted
Junos Automation (Scripting)

PyEz under Windows 10

‎04-19-2020 09:05 AM

I am trying to install PyEz on my Windows 10 laptop. Installing on Ubuntu was straightforward but I've run into a problem under Win10.

 

Referring to the DO PyEz Cookbook, I installed Python (3.8.2) on my Win10 laptop. I also installed the prerequisites as noted on the Juniper website (ecdsa, pip, pycrypto). Then using <pip install junos-eznc> I get PyEz installed without any apprent error and now have version 2.4.0 in place.

 

When I attempt to test the installation, I get the error below as it appears the 'fnctl' functions are not available.

 

Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
>>> from jnpr.junos import Device
...

import fcntl
ModuleNotFoundError: No module named 'fcntl'

 

Is there a solution for Windows platforms? 

 

TIA

3 REPLIES 3
Highlighted
Junos Automation (Scripting)

Re: PyEz under Windows 10

‎04-19-2020 07:19 PM
Hi ivor,

Please check out "portalocker" - https://stackoverflow.com/questions/1422368/fcntl-substitute-on-windows

Hope this helps.

Regards,
-r.

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

If this solves your problem, please mark this post as "Accepted Solution."
Kudos are always appreciated :).
Highlighted
Junos Automation (Scripting)

Betreff: PyEz under Windows 10

‎06-18-2020 01:06 PM

I don't know if this issue still exists for you, but you can perform "pip install git+https://github.com/Juniper/py-junos-eznc.git" as a workaround. There seems to be an issue on the current stable version of junos-eznc for Windows.

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

If this solves your problem, please mark this post as "Accepted Solution".
If you think that my answer was helpful, please spend some Kudos.
Highlighted
Junos Automation (Scripting)

Betreff: PyEz under Windows 10

‎07-02-2020 03:47 PM

This error is due to an import error with the standard Google version of TextFSM when using Windows.

I fixed it by removing my current version of textfsm (pip uninstall text fsm) and installing Kirk Byers version of textfsm that includes the necessary fixes. Make sure to download the branch that includes the fix for windows ->

 

pip install -U git+https://github.com/ktbyers/textfsm.git@30b55e037437e513e48f127cbeb56f83787aaeb5

 

Kudos to Kirk for figuring this out.

 

Feedback