cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
782
Views
0
Helpful
2
Replies

YDK for XML Serialize/Deserialize

brfoster
Cisco Employee
Cisco Employee

I was able to get YDK-gen to build my SDK based on YANG models.  I'm doing a simple test and I just want YDK to spit out the XML.  This gives tracebacks...

from ydk.models.cisco_customer import Data

from ydk.services import CodecService

from ydk.providers import NetconfServiceProvider

myservice = CodecService()

myprovider = NetconfServiceProvider()

foo = Data()

cust = foo.Customer()

cust.name = "Bill"

print(myservice.encode(myprovider, foo))

C:\Users\brfoster\virtualenvs\epnm_testing\Scripts\python.exe C:/Users/brfoster/PycharmProjects/EPNM/tests/testydk.py

Traceback (most recent call last):

  File "C:/Users/brfoster/PycharmProjects/EPNM/tests/testydk.py", line 2, in <module>

    from ydk.models.cisco_customer import Data

  File "C:\Users\brfoster\virtualenvs\epnm_testing\lib\site-packages\ydk\models\cisco_customer.py", line 15, in <module>

    from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict

  File "C:\Users\brfoster\virtualenvs\epnm_testing\lib\site-packages\ydk\types.py", line 23, in <module>

    from builtins import str

ImportError: No module named builtins

1 Accepted Solution

Accepted Solutions

lilyl2
Level 1
Level 1

Hi Jonathan,

We recently added support for python3, which initially introduced a dependency on the future package. We are currently working to remove this dependency, but for the time being, please install the future package https://pypi.python.org/pypi/future.

View solution in original post

2 Replies 2

lilyl2
Level 1
Level 1

Hi Jonathan,

We recently added support for python3, which initially introduced a dependency on the future package. We are currently working to remove this dependency, but for the time being, please install the future package https://pypi.python.org/pypi/future.

That fixed it, thanks!