cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
686
Views
3
Helpful
11
Replies
Beginner

YDK Install Error on CentOS 7

Running setup.py install for ydk ... error

    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2LoqwZ/ydk/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0EWcNH-record/install-record.txt --single-version-externally-managed --compile:

    running install

    running build

    running build_py

    creating build

    creating build/lib.linux-x86_64-2.7

    creating build/lib.linux-x86_64-2.7/ydk

    copying ydk/__init__.py -> build/lib.linux-x86_64-2.7/ydk

    copying ydk/exthook.py -> build/lib.linux-x86_64-2.7/ydk

    creating build/lib.linux-x86_64-2.7/ydk/entity_utils

    copying ydk/entity_utils/__init__.py -> build/lib.linux-x86_64-2.7/ydk/entity_utils

    copying ydk/entity_utils/entity_utils.py -> build/lib.linux-x86_64-2.7/ydk/entity_utils

    creating build/lib.linux-x86_64-2.7/ydk/errors

    copying ydk/errors/__init__.py -> build/lib.linux-x86_64-2.7/ydk/errors

    copying ydk/errors/error_handler.py -> build/lib.linux-x86_64-2.7/ydk/errors

    creating build/lib.linux-x86_64-2.7/ydk/ext

    copying ydk/ext/__init__.py -> build/lib.linux-x86_64-2.7/ydk/ext

    creating build/lib.linux-x86_64-2.7/ydk/filters

    copying ydk/filters/__init__.py -> build/lib.linux-x86_64-2.7/ydk/filters

    creating build/lib.linux-x86_64-2.7/ydk/logging

    copying ydk/logging/__init__.py -> build/lib.linux-x86_64-2.7/ydk/logging

    creating build/lib.linux-x86_64-2.7/ydk/models

    copying ydk/models/__init__.py -> build/lib.linux-x86_64-2.7/ydk/models

    creating build/lib.linux-x86_64-2.7/ydk/path

    copying ydk/path/__init__.py -> build/lib.linux-x86_64-2.7/ydk/path

    creating build/lib.linux-x86_64-2.7/ydk/providers

    copying ydk/providers/__init__.py -> build/lib.linux-x86_64-2.7/ydk/providers

    copying ydk/providers/codec_provider.py -> build/lib.linux-x86_64-2.7/ydk/providers

    creating build/lib.linux-x86_64-2.7/ydk/services

    copying ydk/services/__init__.py -> build/lib.linux-x86_64-2.7/ydk/services

    copying ydk/services/codec_service.py -> build/lib.linux-x86_64-2.7/ydk/services

    copying ydk/services/crud_service.py -> build/lib.linux-x86_64-2.7/ydk/services

    copying ydk/services/executor_service.py -> build/lib.linux-x86_64-2.7/ydk/services

    copying ydk/services/netconf_service.py -> build/lib.linux-x86_64-2.7/ydk/services

    creating build/lib.linux-x86_64-2.7/ydk/types

    copying ydk/types/__init__.py -> build/lib.linux-x86_64-2.7/ydk/types

    copying ydk/types/py_types.py -> build/lib.linux-x86_64-2.7/ydk/types

    creating build/lib.linux-x86_64-2.7/ydk/path/sessions

    copying ydk/path/sessions/__init__.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions

    copying ydk/path/sessions/netconf_session.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions

    copying ydk/path/sessions/restconf_session.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions

    running build_ext

    -- The C compiler identification is GNU 4.8.5

    -- The CXX compiler identification is GNU 4.8.5

    -- Check for working C compiler: /bin/cc

    -- Check for working C compiler: /bin/cc -- works

    -- Detecting C compiler ABI info

    -- Detecting C compiler ABI info - done

    -- Detecting C compile features

    -- Detecting C compile features - done

    -- Check for working CXX compiler: /bin/c++

    -- Check for working CXX compiler: /bin/c++ -- works

    -- Detecting CXX compiler ABI info

    -- Detecting CXX compiler ABI info - done

    -- Detecting CXX compile features

    -- Detecting CXX compile features - done

    python version: 2.7

    -- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)

    pybind11 include: /usr/include/python2.7;/root/.local/include/python2.7

    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

    Please set them or make sure they are set and tested correctly in the CMake files:

    PYTHON_LIBRARY (ADVANCED)

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    curl_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    pcre_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    ssh_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    ssh_threads_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    xml2_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    xslt_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

    ydk_location

        linked by target "ydk_" in directory /tmp/pip-build-2LoqwZ/ydk

   

    -- Configuring incomplete, errors occurred!

    See also "/tmp/pip-build-2LoqwZ/ydk/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log".

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-build-2LoqwZ/ydk/setup.py", line 149, in <module>

        zip_safe=False,

      File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup

        dist.run_commands()

      File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands

        self.run_command(cmd)

      File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command

        cmd_obj.run()

      File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 53, in run

        return _install.run(self)

      File "/usr/lib64/python2.7/distutils/command/install.py", line 563, in run

        self.run_command('build')

      File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command

        self.distribution.run_command(command)

      File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command

        cmd_obj.run()

      File "/usr/lib64/python2.7/distutils/command/build.py", line 127, in run

        self.run_command(cmd_name)

      File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command

        self.distribution.run_command(command)

      File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command

        cmd_obj.run()

      File "/tmp/pip-build-2LoqwZ/ydk/setup.py", line 72, in run

        self.build_extension(ext)

      File "/tmp/pip-build-2LoqwZ/ydk/setup.py", line 104, in build_extension

        subprocess.check_call([cmake_executable, ext.sourcedir] + cmake_args, cwd=self.build_temp)

      File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call

        raise CalledProcessError(retcode, cmd)

    subprocess.CalledProcessError: Command '['cmake3', '/tmp/pip-build-2LoqwZ/ydk', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-2LoqwZ/ydk/build/lib.linux-x86_64-2.7', '-DPYBIND11_INCLUDE=/usr/include/python2.7;/root/.local/include/python2.7', '-DPYTHON_VERSION=2.7', '-DCMAKE_BUILD_TYPE=Release', '-DCOVERAGE=False']' returned non-zero exit status 1

   

    ----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2LoqwZ/ydk/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0EWcNH-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2LoqwZ/ydk/

[root@localhost ~]# cat /etc/centos-release

CentOS Linux release 7.4.1708 (Core)

[root@localhost ~]# which cmake

/bin/cmake

[root@localhost ~]# which cmake3

/bin/cmake3

Any ideas?

Brandon

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: YDK Install Error on CentOS 7

Can you please install the rest of the dependencies and try again?

https://github.com/CiscoDevNet/ydk-py/blob/master/README.rst#linux

Thanks

Cisco Communities <https://communities.cisco.com/>

YDK Install Error on CentOS 7

reply from Brandon Crenshaw<https://communities.cisco.com/people/crench%4092> in DevNet > YANG Development Kit (YDK) - View the full discussion<https://communities.cisco.com/message/287740#287740>

View solution in original post

11 REPLIES 11
Highlighted
Cisco Employee

Re: YDK Install Error on CentOS 7

Do you have these and other dependencies specified in the README?

sudo yum install libssh-devel gcc-c++ python-devel
Highlighted
Beginner

Re: YDK Install Error on CentOS 7

Python Lib was found after installing these but CMake still errors out due to unset variables:

python version: 2.7

    -- Found PythonLibs: /usr/lib64/libpython2.7.so (found version "2.7.5")

    pybind11 include: /usr/include/python2.7;/root/.local/include/python2.7

    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

    Please set them or make sure they are set and tested correctly in the CMake files:

    curl_location

        linked by target "ydk_" in directory /tmp/pip-build-Utn4yz/ydk

    pcre_location

        linked by target "ydk_" in directory /tmp/pip-build-Utn4yz/ydk

    xml2_location

        linked by target "ydk_" in directory /tmp/pip-build-Utn4yz/ydk

    xslt_location

        linked by target "ydk_" in directory /tmp/pip-build-Utn4yz/ydk

    ydk_location

        linked by target "ydk_" in directory /tmp/pip-build-Utn4yz/ydk

   

    -- Configuring incomplete, errors occurred!

    See also "/tmp/pip-build-Utn4yz/ydk/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log".

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-build-Utn4yz/ydk/setup.py", line 149, in <module>

        zip_safe=False,

      File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup

        dist.run_commands()

      File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands

        self.run_command(cmd)

      File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command

        cmd_obj.run()

      File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 53, in run

        return _install.run(self)

      File "/usr/lib64/python2.7/distutils/command/install.py", line 563, in run

        self.run_command('build')

      File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command

        self.distribution.run_command(command)

      File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command

        cmd_obj.run()

      File "/usr/lib64/python2.7/distutils/command/build.py", line 127, in run

        self.run_command(cmd_name)

      File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command

        self.distribution.run_command(command)

      File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command

        cmd_obj.run()

      File "/tmp/pip-build-Utn4yz/ydk/setup.py", line 72, in run

        self.build_extension(ext)

      File "/tmp/pip-build-Utn4yz/ydk/setup.py", line 104, in build_extension

        subprocess.check_call([cmake_executable, ext.sourcedir] + cmake_args, cwd=self.build_temp)

      File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call

        raise CalledProcessError(retcode, cmd)

    subprocess.CalledProcessError: Command '['cmake3', '/tmp/pip-build-Utn4yz/ydk', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-Utn4yz/ydk/build/lib.linux-x86_64-2.7', '-DPYBIND11_INCLUDE=/usr/include/python2.7;/root/.local/include/python2.7', '-DPYTHON_VERSION=2.7', '-DCMAKE_BUILD_TYPE=Release', '-DCOVERAGE=False']' returned non-zero exit status 1

   

    ----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Utn4yz/ydk/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rnLlFm-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Utn4yz/ydk/

Highlighted
Cisco Employee

Re: YDK Install Error on CentOS 7

Can you please install the rest of the dependencies and try again?

https://github.com/CiscoDevNet/ydk-py/blob/master/README.rst#linux

Thanks

Cisco Communities <https://communities.cisco.com/>

YDK Install Error on CentOS 7

reply from Brandon Crenshaw<https://communities.cisco.com/people/crench%4092> in DevNet > YANG Development Kit (YDK) - View the full discussion<https://communities.cisco.com/message/287740#287740>

View solution in original post

Highlighted
Beginner

Re: YDK Install Error on CentOS 7

Was able to install ydk but the XE models fail now.  What is interesting is that all the other models install just fine.

[root@localhost ~]# pip install --install-option="--install-purelib=/usr/lib64/python2.7/site-packages" --no-deps ydk-models-cisco-ios-xe

/usr/lib/python2.7/site-packages/pip/commands/install.py:188: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.

  cmdoptions.check_install_build_global(options)

Collecting ydk-models-cisco-ios-xe

  Downloading https://files.pythonhosted.org/packages/35/d0/63ac59cc2037b1a3fe0c83def2e6af5baac07cd58b8d04c16d60f2f03c66/ydk-models-cisco-ios-xe-16.8.1.tar.gz (9.6MB)

    100% |████████████████████████████████| 9.6MB 149kB/s

Installing collected packages: ydk-models-cisco-ios-xe

  Running setup.py install for ydk-models-cisco-ios-xe ... error

    Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mFPL4B/ydk-models-cisco-ios-xe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-R_XVLx-record/install-record.txt --single-version-externally-managed --compile --install-purelib=/usr/lib64/python2.7/site-packages:

    running install

    running build

    running build_py

    creating build

    creating build/lib

    creating build/lib/ydk

    copying ydk/__init__.py -> build/lib/ydk

    creating build/lib/ydk/models

    copying ydk/models/__init__.py -> build/lib/ydk/models

    creating build/lib/ydk/models/cisco_ios_xe

    copying ydk/models/cisco_ios_xe/__init__.py -> build/lib/ydk/models/cisco_ios_xe

    copying ydk/models/cisco_ios_xe/_yang_ns.py -> build/lib/ydk/models/cisco_ios_xe

  ...ETC..

    byte-compiling /usr/lib64/python2.7/site-packages/ydk/models/cisco_ios_xe/Cisco_IOS_XE_mpls.py to Cisco_IOS_XE_mpls.pyc

    byte-compiling /usr/lib64/python2.7/site-packages/ydk/models/cisco_ios_xe/Cisco_IOS_XE_mpls_fwd_oper.py to Cisco_IOS_XE_mpls_fwd_oper.pyc

    byte-compiling /usr/lib64/python2.7/site-packages/ydk/models/cisco_ios_xe/Cisco_IOS_XE_mpls_ldp.py to Cisco_IOS_XE_mpls_ldp.pyc

    byte-compiling /usr/lib64/python2.7/site-packages/ydk/models/cisco_ios_xe/Cisco_IOS_XE_nat_oper.py to Cisco_IOS_XE_nat_oper.pyc

    byte-compiling /usr/lib64/python2.7/site-packages/ydk/models/cisco_ios_xe/Cisco_IOS_XE_native.py to Cisco_IOS_XE_native.pyc

  

    ----------------------------------------

Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mFPL4B/ydk-models-cisco-ios-xe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-R_XVLx-record/install-record.txt --single-version-externally-managed --compile --install-purelib=/usr/lib64/python2.7/site-packages" failed with error code -9 in /tmp/pip-build-mFPL4B/ydk-models-cisco-ios-xe/

Highlighted
Beginner

Re: YDK Install Error on CentOS 7

Since only the XE models are giving me issues, I tried generating 16.6.2 models considering im only going to be interacting with devices with 16.6.2 XE but I get a memory error when trying to generate.

Processing 337 of 339 /root/ydk-gen/gen-api/.cache/models/cisco_ios_xe@16.6.2/tailf-rest-error.yang

Processing 338 of 339 /root/ydk-gen/gen-api/.cache/models/cisco_ios_xe@16.6.2/tailf-rest-query.yang

Processing 339 of 339 /root/ydk-gen/gen-api/.cache/models/cisco_ios_xe@16.6.2/tailf-xsd-types.yang

Time taken for code/doc generation: 2 minutes 38 seconds

Creating python package...

Traceback (most recent call last):

  File "./generate.py", line 447, in <module>

    create_pip_packages(output_directory)

  File "./generate.py", line 193, in create_pip_packages

    exit_code = subprocess.call(args, env=os.environ.copy())

  File "/usr/lib64/python2.7/subprocess.py", line 524, in call

    return Popen(*popenargs, **kwargs).wait()

  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__

    errread, errwrite)

  File "/usr/lib64/python2.7/subprocess.py", line 1224, in _execute_child

    self.pid = os.fork()

OSError: [Errno 12] Cannot allocate memory

When trying to install what i generated, i get this.

[root@localhost cisco_ios_xe-bundle]# pip install cisco_ios_xe@16.6.2.tar.gz

Processing ./cisco_ios_xe@16.6.2.tar.gz

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

    IOError: [Errno 2] No such file or directory: '/tmp/pip-ndux57-build/setup.py'

   

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-ndux57-build/

Highlighted
Cisco Employee

Re: YDK Install Error on CentOS 7

Looks like there are some memory restrictions on the system you are using to install. Can you try the below option, which should skip the compile step?

pip install --install-option="--install-purelib=/usr/lib64/python2.7/site-packages" --no-deps --no-compile ydk-models-cisco-ios-xe 

For the generation, do you have access to a system that has more RAM?

Highlighted
Beginner

Re: YDK Install Error on CentOS 7

So i actually skipped the generating part as well.  What I ended up doing was installing ydk, models-ietf, and XE as they currently are.  The only error i get is from my post at 11:09 on 04/16.  After uninstalling and installing a couple of times, I finally got XE-16.8.1 to install but noticed that my VM was very slow, even after doubling the RAM.  My guess is the CPU was maxed.  Are there a significant amount more resources required when working with the XE models in 16.8.1?

Highlighted
Cisco Employee

Re: YDK Install Error on CentOS 7

Yes. The python model API for the XE Native model is quite large because of the size of the yang model. There are ways to work around this. You can try the --one-class-per-module option (see README) which generates smaller python modules which are faster to load. The only difference is the import statement will change per the below example

git clone https://github.com/CiscoDevNet/ydk-gen.git
cd ydk-gen
git checkout -b 0.7.1
pip install -r requirements
 
$ ./generate.py -h
usage: generate.py [-h] [--bundle BUNDLE]
                   [--adhoc-bundle-name ADHOC_BUNDLE_NAME]
                   [--adhoc-bundle ADHOC_BUNDLE [ADHOC_BUNDLE ...]] [--core]
                   [--output-directory OUTPUT_DIRECTORY] [-p] [-c] [-g] [-l]
                   [-v] [--generate-doc] [--generate-tests] [-o]
 
Generate YDK artefacts:
 
optional arguments:
...
-o, --one-class-per-module
                        Generate separate modules for each python class
                        corresponding to yang containers or lists.
 
./generate.py --bundle profiles/bundles/openconfig_0_1_5.json --python --one-class-per-module

Import:

from ydk.models.openconfig.openconfig_bgp import Bgp
 

changes to:

from ydk.models.openconfig.openconfig_bgp.bgp.bgp import Bgp
Highlighted
Beginner

Re: YDK Install Error on CentOS 7

Do i need to do this if it successfully installed?  As in, does doing this only help during install or will it help when using the modules too?  I did get it to install eventually without this.

Highlighted
Cisco Employee

Re: YDK Install Error on CentOS 7

This will reduce the run time memory consumption.

For reference, I have attached the package generated with the below command:

./generate.py --bundle profiles/bundles/cisco-ios-xe_16_6_2.json --python -o

To install, please download and run:

pip uninstall ydk-models-cisco-ios-xe -y

pip install --install-option="--install-purelib=/usr/lib64/python2.7/site-packages" --no-deps --no-compile ydk-models-cisco-ios-xe*.tar.gz 
Highlighted
Beginner

Re: YDK Install Error on CentOS 7

Appreciate the help on this one.  Thanks a bunch

This widget could not be displayed.