Readiness for Python and Jnpr

Just copied couple of python modules on newly built Ubuntu and NOT able to run python programs

user@Ubuntu-TPL:~/python/junoschassis$ python testmodule.py -f devices
Unable to connect to host: invalid literal for int() with base 10: ‘1F5’

>>>Upgrading PIP
$ pip install –upgrade pip

<Last few text>
Installing collected packages: pip
Found existing installation: pip 7.1.0
Uninstalling pip-7.1.0:
Successfully uninstalled pip-7.1.0
Successfully installed pip-8.1.2

>>>Upgrading Python

sudo apt-get -y install build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
mkdir -p ~/python/2.7.10
cd ~/python/2.7.10
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar xzf Python-2.7.10.tgz
cd Python-2.7.10
sudo ./configure
sudo make install
cd ~/

#check version with opening new session

user@Ubuntu-TPL:~$ python
Python 2.7.10 (default, Sep 9 2016, 07:42:38)
[GCC 4.8.4] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

>>> Installing PYEZ

$ apt-get install python-pip python-dev libxml2-dev libxslt-dev libssl-dev libffi-dev
$ wget https://bootstrap.pypa.io/get-pip.py -O – | sudo python

$ sudo pip install junos-eznc

Shouldn’t any error while importing jnpr.junos

user@Ubuntu-TPL:~$ python
Python 2.7.10 (default, Sep 9 2016, 07:42:38)
[GCC 4.8.4] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import jnpr.junos
>>>

>>>Juniper device, configuration – commit.

re0> show configuration system services
netconf {
ssh;
}

Finally, able to run my python module

user@Ubuntu-TPL:~/python/junoschassis$ python testmodule.py -f devices
Online FPCs are [‘0’, ‘1’, ‘3’] – Respective CPU is [‘8’, ‘9’, ’12’]
Provided IP, looks backup RE

35 thoughts on “Readiness for Python and Jnpr”

Leave a Reply

Your email address will not be published. Required fields are marked *