Showing results for 
Search instead for 
Did you mean: 
Luis Perez

YDK issues Lab 10.8 DEVASC ELearning Training Use Cisco SDK and Python for Automation Scripting

Problems executing python script in this specific lab of DEVASC training course, when you instantiate CRUDService() it fails with messages: "TypeError: must be called when overriding __init__"  


Ive tried to make changes inside of the crud_service, executor_service and netconf_service python files as mentioned here actually the previous issue dissapear but now is showing issus related with the read method of the CRUDService object. 


The python script executed is attached.


Someone knows which steps we have to take in account to make this script suscessfully work?




Hi Luis

When building model you must always start from the top level entity and keep in mind that container and list classes has already been instantiated in parent class. Your script should be:

from import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xe import Cisco_IOS_XE_native as xe_model # you had error in this line

# CSR1kv1 Credentials
ip = ''
port_n = 830
user = 'cisco'
paswd = 'cisco'
proto = 'ssh'

if __name__ == '__main__':
# open the connection with Netconf server
provider = NetconfServiceProvider(address=ip, port=port_n, username=user, password=paswd, protocol=proto)

# initialize CRUD Service
crud = CRUDService()

# create a new instance of Native object
xe_native = xe_model.Native() # always start from top level entity
xe_interfaces = xe_native.interfaces # object 'interfaces' has already been instantiated

# read the interfaces with the help of read function
interfaces_data =, xe_interfaces)

# print the primary address of the fifth gigabitethernet interface
Yan Gorelik
YDK Solutions

Have the same problem when initializing CRUDService:


Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
>>> from import CRUDService
>>> crud = CRUDService()
TypeError: must be called when overriding __init__


Please your help to solve this problem.


Try this 


I made the changes inside of the file suggested and that solve the issue

Thanks Yan i tried again only modifying the file as mentioned here and without any change in the code the scritp works as expected

Hello Luis and Jose

Since the 0.8.5 merge to upstream (still officially not released) I have fixed few bugs including the above one. Therefore I suggest you to use master branch from my fork. The installation is very simple:

git clone

cd ydk-gen

./ --core

For YDK test drive I suggest to use docker:

docker run -it ydksolutions/ydk-gen

Yan Gorelik
YDK Solutions
Content for Community-Ad

This widget could not be displayed.