cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2049
Views
0
Helpful
4
Replies

Module can not find in nso python-vm but it did exist in local

yongz2
Cisco Employee
Cisco Employee

Hello ,

 

Is anyone know how to find path of python-vm which nso used.

I used module ipaddress in python, it worked form my local, but in nso log file it's said there is no module name ipaddress

from nso log file 

******************************************************************************************

<INFO> 8-Oct-2018::14:50:49.941 NSOCBA ncs[5858]: Azure-hosted :: import ipaddress
ImportError: No module named ipaddress

 

from my local

******************************************************************************************

[root@NSO]# python
Python 3.6.3 (default, Jan 4 2018, 16:40:53)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> exit()

 

 

So how to confirm which python vm is used for nso and how to add another module for nso python-vm?

1 Accepted Solution

Accepted Solutions

You only have to modify ncs-start-python-vm, or better, your own copy of the script. This is described in the development guide in more detail.

 

Python versions 2.7.5 or higher and Python 3.4 or higher are supported. (This is for 4.7, check your documentation for more details).

View solution in original post

4 Replies 4

vleijon
Cisco Employee
Cisco Employee
The python-vm is controlled by /python-vm/start-command, by default that is $NCS_DIR/bin/ncs-start-python-vm.

You can create your own start command if you want to control how the python-vm is started, or you can make sure that $PYTHONPATH is set when ncs is started.

Thanks Vleijon,

 

And could I know how to change python version in nso?

eg. current nso is used python2. Does it possible to modify startup.py to change nso to use python3

You only have to modify ncs-start-python-vm, or better, your own copy of the script. This is described in the development guide in more detail.

 

Python versions 2.7.5 or higher and Python 3.4 or higher are supported. (This is for 4.7, check your documentation for more details).

Hello Vleijon,

 

It did there, thanks so much!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: