0

I have to install pyez using pip. This at least is stated as requirement to use the role Juniper.junos to run ansible commands against Juniper routers. I'm using cygwin on a windows laptop without any adminrights in a corporate network. The problem is, I cannot use the corporate proxy because of that proprietary Microsoft NTLM protocol so a simple "pip install junos-eznc" is not possible. But what I could do is download the software, tarball or whatever and run pip against that downloaded stuff. I tried several things and failed miserably and google doesn't return anything useful. Can anyone help? What am I supposed to do to get that installed successfully? Many thanks in advance.

zweiund40
  • 65
  • 1
  • 2
  • 7
  • http://cntlm.sourceforge.net/, http://ntlmaps.sourceforge.net/, https://stackoverflow.com/a/50532045/7976758 – phd Apr 13 '21 at 18:44
  • Another approach: [download wheels](https://stackoverflow.com/a/14447068/7976758) on a connected machine, copy them to your corporate host and install. – phd Apr 13 '21 at 18:47
  • As I said, I have no admin privileges. Installing cntlm means executing the cntlm.exe and then u are required to enter an admin password. ntlmaps isn't a solution, too. Python version is too old. Furthermore, there is no connected machine available. – zweiund40 Apr 13 '21 at 19:12

2 Answers2

0

Youcan download required package and install it like this

pip install <file_name>
  • I tried it but I failed. I downloaded py-junos-eznc-2.5.4.tar.gz, unzipped and untarred it and tried pip3 install file:///home/user/Tmp/py-junos-eznc-2.5.4. Errormessages. I tried it against the tar file and the tar.gz file, too. Errormessages. – zweiund40 Apr 13 '21 at 18:23
  • @zweiund40 Unfortunately, I have not much experience with python on Windows, so I'm not sure if I can help you. But could you bring exact error message text? – Andrej Zacharevicz Apr 13 '21 at 18:29
  • cygwin is a linux shell on a Windows installation. So, it's not python on Windows. It is python on Linux. The error message: ```$ pip3 install file:///home/A789808/Tmp/py-junos-eznc-2.5.4 Processing /home/A789808/Tmp/py-junos-eznc-2.5.4 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 8] Name or service not known')': /simple/lxml/ ... ``` – zweiund40 Apr 13 '21 at 18:53
  • Output was too long. Second part: ```ERROR: Could not find a version that satisfies the requirement lxml>=3.2.4 (from junos-eznc) ERROR: No matching distribution found for lxml>=3.2.4 ``` – zweiund40 Apr 13 '21 at 18:56
0

I solved it.

First issue: Proxy

px.exe on https://github.com/genotrance/px/releases. 

Second issue: missing libs:

I had to install several libs and make on cygwin in order to get junos-eznc installed:

libxml2-devel
libxslt-devel
libffi-devel
libssl-devel
make

Third issue: cryptography

Don't use latest version of cryptography because it'll need rust which is pita on cygwin

pip install cryptography==3.2

... and then ...

pip install junos-eznc

After that, installation of ...

ansible-galaxy install Juniper.junos

... was quite smooth

zweiund40
  • 65
  • 1
  • 2
  • 7