cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5924
Views
0
Helpful
20
Replies

installing ydk-models-cisco-ios-xr

Mawaheb Kabbara
Cisco Employee
Cisco Employee

hi, i tried to deploy YDK on Ubuntu 20.04 by following the documentation and the installation fails at some point.  Basically the GPRC and GNMI all succeed but when it comes to installing ydk-models-cisco-ios-xr this is where things break.  I finally installed the Docker image when i gave up and i was able to finish the install properly and to even run the YDK.

 

I have two questions:

1) Having installed YDK, how can i access it from any Python IDE so that I can start using import ydd.ietf etc. in my code?

2) why installing with such commands keep failing all the time "pip3 install ydk-models-cisco-ios-xr", even importing from the IDE like Pycharm also fails.

 

the attached file lists errors when attempting to issue the pip install command, please advise, thanks

20 Replies 20

I also run the pyang *.yang as mentioned in the output and below is the result...

(project_ydk) cmendoza@ubuntu:~/Documents/ydk-gen/gen-api/.cache/models/cisco_ios_xr@6.3.1$ pyang *.yangCisco-IOS-XR-aaa-protocol-radius-oper.yang:17: warning: imported module "Cisco-IOS-XR-aaa-lib-datatypes" not used
Cisco-IOS-XR-atm-vcm-cfg.yang:12: warning: imported module "Cisco-IOS-XR-types" not used
Cisco-IOS-XR-atm-vcm-oper.yang:14: warning: imported module "Cisco-IOS-XR-atm-common-datatypes" not used
Cisco-IOS-XR-ethernet-cfm-sat-cfg.yang:17: warning: imported module "Cisco-IOS-XR-l2-eth-infra-cfg" not used
Cisco-IOS-XR-freqsync-sat-cfg.yang:14: warning: imported module "Cisco-IOS-XR-l2-eth-infra-cfg" not used
Cisco-IOS-XR-ipv4-bgp-oc-oper.yang:14: warning: imported module "Cisco-IOS-XR-ipv4-bgp-datatypes" not used
Cisco-IOS-XR-ncs4k-freqsync-oper.yang:15: warning: imported module "Cisco-IOS-XR-freqsync-datatypes" not used
Cisco-IOS-XR-ping-act.yang:7: warning: imported module "Cisco-IOS-XR-types" not used
Cisco-IOS-XR-ptp-oper.yang:14: warning: imported module "Cisco-IOS-XR-ptp-datatypes" not used
Cisco-IOS-XR-qos-ma-sat-cfg.yang:12: warning: imported module "Cisco-IOS-XR-types" not used
Cisco-IOS-XR-syslog-act.yang:7: error: module "ietf-syslog-types" not found in search path
(project_ydk) cmendoza@ubuntu:~/Documents/ydk-gen/gen-api/.cache/models/cisco_ios_xr@6.3.1$

 

What should I be doing next? Should I delete these yang files from these directory? How about on the profile JSON file should I delete these as well?

Hi Christopher

I found and fixed a bug in the dependency ietf profile. I have tested the fixed profiles on my side and committed the changes. Please run 'git pull' on ydk-gen repository and then repeat bundle generation.

Regarding the bundle name. It was designed long time ago (before me) to have the same bundle name for different versions of IOS XR bundles. I attempted to change that, but with no success. It is obvious to me that if you have devices of different versions, you should have corresponding different bundle names. To address your need I suggest you edit the cisco-ios-xr_6_3_1.json profile by changing bundle name like this:

"name": "cisco-ios-xr-631",

 

Yan Gorelik
YDK Solutions

Hi yangorelik,

 

I have followed your instructions, please see attach text file, and before I executed the bundle generation I have edited the json file with the below changes.

 

"name": "cisco-ios-xr-631",
"version": "6.3.1",
"core_version": "0.8.6",

 

it looked like it was successful however executing pip list does not show the cisco-ios-xr-631

 

(project_ydk) cmendoza@ubuntu:~/Documents/ydk-gen$ pip list | grep ydk
ydk 0.8.6
ydk-models-cisco-ios-xe 16.9.3.post1
ydk-models-cisco-ios-xr 6.6.3
ydk-models-ietf 0.1.5.post2
ydk-models-openconfig 0.1.8
ydk-service-gnmi 0.4.0.5
(project_ydk) cmendoza@ubuntu:~/Documents/ydk-gen$

 

when I did an import from python below is the error I am getting...

 

"import ydk.models.cisco_ios_xr_631"

 

(project_ydk) cmendoza@ubuntu:~/Documents/project_ydk$ /home/cmendoza/Documents/project_ydk/bin/python /home/cmendoza/Documents/project_ydk/main.py
Traceback (most recent call last):
File "/home/cmendoza/Documents/project_ydk/main.py", line 4, in <module>
import ydk.models.cisco_ios_xr_631
ModuleNotFoundError: No module named 'ydk.models.cisco_ios_xr_631'

Do I still need to do the below steps?

 

# Installation
Create a source distribution for the bundle:
```
    $ python setup.py sdist
```
Install the bundle:
```
    $ pip install dist/ydk-*.tar.gz
```

Sorry for spamming...I decided to override the 663, revert all the changes I made in the 631 json file and re-run the generate.py again....and it finally showed the 631 in the pip list...

 

(project_ydk) cmendoza@ubuntu:~/Documents/project_ydk$ pip list | grep ydk
ydk 0.8.6
ydk-models-cisco-ios-xe 16.9.3.post1
ydk-models-cisco-ios-xr 6.3.1
ydk-models-ietf 0.1.5.post2
ydk-models-openconfig 0.1.8

ydk-service-gnmi 0.4.0.5
(project_ydk) cmendoza@ubuntu:~/Documents/project_ydk$

 

This is good enough for me at the moment because my lab is purely 631 and I am only doing this for my learning purposes

 

Thanks a lot yangorelik for all the help, it has been a long exchange of messages before I was able to come to my desired state and thank you for your patience with me.

Hi Christopher

I can see in the log that installation process was killed (cannot identify the reason):

Installing collected packages: ydk-models-cisco-ios-xr-631
Killed

Code generation and installation completed successfully!

You can try install the package manually in verbose mode to see the installation process details:

source ~/venv/bin/activate
cd ydk-gen
pip install gen-api/python/cisco_ios_xr_631-bundle/dist/ydk*.gz -v   

 

Yan Gorelik
YDK Solutions