cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
445
Views
5
Helpful
6
Replies
Cisco Employee

Changing Python version in System Installation fails. (NSO 4.7.2.1)

Hi everyone.

We are using NSO 4.7.2.1

Now we are trying to use Python 3.6.6

NSO 4.7.2.1 Development / Chapter 3. The NSO Python VM says as follows.

 

Configure NSO to use a custom start command (recommended)

NSO can be configured to use a custom start command for starting a Python VM. This can be done by first copying the file $NCS_DIR/bin/ncs-start-python-vm to a new file, then change the last line of that file to start the desired version of Python. After that start a CLI against NSO and configure the new file as the start command for a new Python VM.

 

Updating the default start command (not recommended)

Changing the last line of $NCS_DIR/bin/ncs-start-python-vm is of course an option but altering any of the installation files of NSO is discouraged.

 

In short, it says

  1. Copying the original installation file to new one, and edit it, then point that file in start command. It is recommended.
  2. Editing the original installation file is not recommended.

 

So we tried to follow the recommended procedure 1.

In Local Installation, it worked as we expected.

 

Default Python (Python 2.7.5 is started)

<INFO> 30-Jan-2019::07:02:10.488 asr9k-config-if MainThread: - Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

<INFO> 30-Jan-2019::07:02:10.489 asr9k-config-if MainThread: - Starting...

<INFO> 30-Jan-2019::07:02:10.490 asr9k-config-if MainThread: - Started

 

Change to Python3 (Python 3.6.6 is started as expected.)

<INFO> 30-Jan-2019::07:03:16.623 asr9k-config-if MainThread: - Python 3.6.6 (default, Aug 13 2018, 18:24:23) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

<INFO> 30-Jan-2019::07:03:16.623 asr9k-config-if MainThread: - Starting...

<INFO> 30-Jan-2019::07:03:16.627 asr9k-config-if MainThread: - Started

 

But in System Installation, the recommended procedure 1 didn’t work, but non-recommended procedure 2 worked.

 

Default Python (Python 2.7.5 is started)

<INFO> 30-Jan-2019::06:53:59.335 asr9k-config-if MainThread: - Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

<INFO> 30-Jan-2019::06:53:59.335 asr9k-config-if MainThread: - Starting...

<INFO> 30-Jan-2019::06:53:59.336 asr9k-config-if MainThread: - Started

 

Change to Python3 by recommended procedure 1 didn’t work. (Python 2.7.5 is started)

<INFO> 30-Jan-2019::06:56:41.470 asr9k-config-if MainThread: - Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

<INFO> 30-Jan-2019::06:56:41.474 asr9k-config-if MainThread: - Starting...

<INFO> 30-Jan-2019::06:56:41.475 asr9k-config-if MainThread: - Started

 

Change to Python3 by non-recommended procedure 2 worked. (Python 3.6.6 is started as expected.)

<INFO> 30-Jan-2019::06:57:49.508 asr9k-config-if MainThread: - Python 3.6.6 (default, Aug 13 2018, 18:24:23) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

<INFO> 30-Jan-2019::06:57:49.508 asr9k-config-if MainThread: - Starting...

<INFO> 30-Jan-2019::06:57:49.514 asr9k-config-if MainThread: - Started

 

The only way to use Python 3.6.6 in System Installation is follow the non-recommended procedure.

So we need to choose it.

 

Is this an expected behavior? 

Any comment would be appreciated.

6 REPLIES 6
Cisco Employee

Re: Changing Python version in System Installation fails. (NSO 4.7.2.1)

Does the python-vm.logs say anything?

 

What if you change the python version the recommended way then restart ncs, does that still exhibit the same behavior?

Cisco Employee

Re: Changing Python version in System Installation fails. (NSO 4.7.2.1)

Hi Joey.

Thank you for the comment.

ncs-python-vm.log shows the message I attached before.

<INFO> 30-Jan-2019::06:56:41.470 asr9k-config-if MainThread: - Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

<INFO> 30-Jan-2019::06:56:41.474 asr9k-config-if MainThread: - Starting...

<INFO> 30-Jan-2019::06:56:41.475 asr9k-config-if MainThread: - Started

 

Restarting ncs exhibits the same behavior.

 

I'll open Service Request for future use.

Cisco Employee

Re: Changing Python version in System Installation fails. (NSO 4.7.2.1)

Did you happen to reach a verdict regarding this?
Cisco Employee

Re: Changing Python version in System Installation fails. (NSO 4.7.2.1)

I opened Service Request.

It'll take long time to fix NSO code.

I'll wait for the fix.

 

Koji Yokoe

Cisco Employee

Re: Changing Python version in System Installation fails. (NSO 4.7.2.1)

Hi All,

I am not sure but try this, it might help.
I installed python using pyenv in (mac, Linux) and pyenv-win in (windows) and set-up there respective path in Environment
Now I installed python 2.7 or python 3.x using pyenv as mentioned in the documentation.

Installations are ready, It's time to use them by setting up pyenv local `python-version` to your project from terminal or cmd
This will automatically set your python2.7 or python3.x respectively as configured into your system path.
If this process works then no need to "Change Python version in System Installation"

Kiran Kumar Kotari
Cisco Employee

Re: Changing Python version in System Installation fails. (NSO 4.7.2.1)