01-18-2019 09:32 AM
I have been trying so hard to install YDK-PY in my MacBook. I followed the given documentary, but it did not work. However, it did work on Linux-based machine Ubuntu. Could you please provide a full installation?
Solved! Go to Solution.
01-19-2019 01:10 PM
Hello khalilmeb
My apologize, the files were no uploaded to Cisco artifactory. I have corrected this issue. The correct links are:
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-service-gnmi-0.4.0.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-cisco-ios-xe-16.9.1.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-cisco-ios-xr-6.5.1.post1.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-cisco-nx-os-9.2.2.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-ietf-0.1.5.post2.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-openconfig-0.1.6.post1.tar.gz
But before you install python packages you have to correct your environment and then install C++ core and optionally gNMI service libraries.
1. The cmake error shows that you need install libssh-0.7.6 (that piece is missing in ydk-py documentation, but already corrected in the next release)
brew reinstall openssl
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
wget https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.6.tar.gz
tar zxf libssh-0.7.6.tar.gz && rm -f libssh-0.7.6.tar.gz
mkdir libssh-0.7.6/build && cd libssh-0.7.6/build
cmake ..
sudo make install
2. Install C++ core library
curl -O https://devhub.cisco.com/artifactory/osx-ydk/0.8.0/libydk-0.8.0-Darwin.pkg
sudo installer -pkg libydk-0.8.0-Darwin.pkg -target /
3. Install gNMI service C++ library (optional). The library has dependency on protobuf, protoc and grpc software, so you need install them first by following gnmi-requirements. Then
curl -O https://devhub.cisco.com/artifactory/osx-ydk/0.8.0/libydk_gnmi-0.4.0-Darwin.pkg sudo installer -pkg libydk_gnmi-0.4.0-Darwin.pkg -target /
4. Install needed Python packages
Please let me know if you face any issue in this installation process.
Regards, Yan
01-18-2019 12:59 PM
Could you please provide details of your environment and detail description of the issue that you are facing.
01-19-2019 08:05 AM
Here I tried to install for other platforms after having the system requirements installed.
http://ydk.cisco.com/py/docs/getting_started.html#other-platforms
Everything in the following lines gave the error below
$ pip install https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz $ pip install https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-service-gnmi-0.4.0.tar.gz $ pip install ydk-models-cisco-ios-xr $ pip install ydk-models-cisco-ios-xe
Here what I got:
Collecting https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
HTTP error 404 while getting https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
Could not install requirement https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz because of error 404 Client Error: for url: https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
Could not install requirement https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz because of HTTP error 404 Client Error: for url: https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz for URL https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
Then, I tried to install from the source following this snippet in http://ydk.cisco.com/py/docs/getting_started.html#installing-from-source
$ git clone https://github.com/CiscoDevNet/ydk-gen.git $ cd ydk-gen/sdk/cpp/core core$ mkdir -p build core$ cd build build$ cmake .. build$ make build$ sudo make install
and this what I got exactly after executing
$ cmake ..
This what I got
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake System: MacOS
-- Found LibXml2: /usr/lib/libxml2.dylib (found version "2.9.4")
Set libyang plugin installation directory to: lib/libyang
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.15") found components: doxygen dot
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:
ssh_threads_location
linked by target "ydk" in directory /Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core
-- Configuring incomplete, errors occurred!
See also "/Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/CMakeFiles/CMakeOutput.log".
However, I have installed ydk in docker which was successfully installed, also successfully installed in Ubuntu server, except in MacOS
01-19-2019 01:10 PM
Hello khalilmeb
My apologize, the files were no uploaded to Cisco artifactory. I have corrected this issue. The correct links are:
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-service-gnmi-0.4.0.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-cisco-ios-xe-16.9.1.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-cisco-ios-xr-6.5.1.post1.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-cisco-nx-os-9.2.2.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-ietf-0.1.5.post2.tar.gz
https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-models-openconfig-0.1.6.post1.tar.gz
But before you install python packages you have to correct your environment and then install C++ core and optionally gNMI service libraries.
1. The cmake error shows that you need install libssh-0.7.6 (that piece is missing in ydk-py documentation, but already corrected in the next release)
brew reinstall openssl
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
wget https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.6.tar.gz
tar zxf libssh-0.7.6.tar.gz && rm -f libssh-0.7.6.tar.gz
mkdir libssh-0.7.6/build && cd libssh-0.7.6/build
cmake ..
sudo make install
2. Install C++ core library
curl -O https://devhub.cisco.com/artifactory/osx-ydk/0.8.0/libydk-0.8.0-Darwin.pkg
sudo installer -pkg libydk-0.8.0-Darwin.pkg -target /
3. Install gNMI service C++ library (optional). The library has dependency on protobuf, protoc and grpc software, so you need install them first by following gnmi-requirements. Then
curl -O https://devhub.cisco.com/artifactory/osx-ydk/0.8.0/libydk_gnmi-0.4.0-Darwin.pkg sudo installer -pkg libydk_gnmi-0.4.0-Darwin.pkg -target /
4. Install needed Python packages
Please let me know if you face any issue in this installation process.
Regards, Yan
01-21-2019 01:30 AM
Thanks for going through this. Well, I have followed every single instruction but still does not work.
After finishing step 3 everything was working perfectly, and when I started installing the given python packages errors start to appear again.
This is from the first python package. As well as for the others.
sudo pip install https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
Password:
The directory '/Users/khalil/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/khalil/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
Downloading https://devhub.cisco.com/artifactory/pypi-ydk/0.8.0/ydk-0.8.0.tar.gz
Requirement already satisfied: pybind11>=2.1.1 in /Users/khalil/anaconda2/lib/python2.7/site-packages (from ydk==0.8.0) (2.2.4)
Installing collected packages: ydk
Running setup.py install for ydk ... error
Complete output from command /Users/khalil/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-req-build-uSjm3u/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-Rg0V79/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-x86_64-2.7
creating build/lib.macosx-10.6-x86_64-2.7/ydk
copying ydk/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk
copying ydk/exthook.py -> build/lib.macosx-10.6-x86_64-2.7/ydk
creating build/lib.macosx-10.6-x86_64-2.7/ydk/filters
copying ydk/filters/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/filters
creating build/lib.macosx-10.6-x86_64-2.7/ydk/types
copying ydk/types/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/types
copying ydk/types/py_types.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/types
creating build/lib.macosx-10.6-x86_64-2.7/ydk/providers
copying ydk/providers/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/providers
copying ydk/providers/codec_provider.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/providers
creating build/lib.macosx-10.6-x86_64-2.7/ydk/path
copying ydk/path/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/path
creating build/lib.macosx-10.6-x86_64-2.7/ydk/ext
copying ydk/ext/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/ext
creating build/lib.macosx-10.6-x86_64-2.7/ydk/entity_utils
copying ydk/entity_utils/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/entity_utils
copying ydk/entity_utils/entity_utils.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/entity_utils
creating build/lib.macosx-10.6-x86_64-2.7/ydk/models
copying ydk/models/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/models
creating build/lib.macosx-10.6-x86_64-2.7/ydk/errors
copying ydk/errors/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/errors
copying ydk/errors/error_handler.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/errors
creating build/lib.macosx-10.6-x86_64-2.7/ydk/logging
copying ydk/logging/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/logging
creating build/lib.macosx-10.6-x86_64-2.7/ydk/services
copying ydk/services/netconf_service.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/services
copying ydk/services/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/services
copying ydk/services/executor_service.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/services
copying ydk/services/crud_service.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/services
copying ydk/services/codec_service.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/services
creating build/lib.macosx-10.6-x86_64-2.7/ydk/path/sessions
copying ydk/path/sessions/netconf_session.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/path/sessions
copying ydk/path/sessions/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/path/sessions
copying ydk/path/sessions/restconf_session.py -> build/lib.macosx-10.6-x86_64-2.7/ydk/path/sessions
running build_ext
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/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
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10")
pybind11 include: /Users/khalil/anaconda2/include/python2.7;/Users/khalil/.local/include/python2.7
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-req-build-uSjm3u/build/temp.macosx-10.6-x86_64-2.7
Scanning dependencies of target ydk_
[ 50%] Building CXX object CMakeFiles/ydk_.dir/python.cpp.o
/tmp/pip-req-build-uSjm3u/python.cpp:22:10: fatal error: 'ydk/path_api.hpp' file not found
#include <ydk/path_api.hpp>
^~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/ydk_.dir/python.cpp.o] Error 1
make[1]: *** [CMakeFiles/ydk_.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-req-build-uSjm3u/setup.py", line 151, in <module>
zip_safe=False,
File "/Users/khalil/anaconda2/lib/python2.7/site-packages/setuptools/__init__.py", line 131, in setup
return distutils.core.setup(**attrs)
File "/Users/khalil/anaconda2/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/Users/khalil/anaconda2/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Users/khalil/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/khalil/anaconda2/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/Users/khalil/anaconda2/lib/python2.7/distutils/command/install.py", line 563, in run
self.run_command('build')
File "/Users/khalil/anaconda2/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/Users/khalil/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/khalil/anaconda2/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/Users/khalil/anaconda2/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/Users/khalil/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/private/tmp/pip-req-build-uSjm3u/setup.py", line 74, in run
self.build_extension(ext)
File "/private/tmp/pip-req-build-uSjm3u/setup.py", line 107, in build_extension
subprocess.check_call([cmake_executable, '--build', '.'], cwd=self.build_temp)
File "/Users/khalil/anaconda2/lib/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2
----------------------------------------
Command "/Users/khalil/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-req-build-uSjm3u/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-Rg0V79/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-req-build-uSjm3u/
Then, I tried to install ydk-gen but still does not work either.
config.status: executing libtool commands
[ 5%] Performing build step for 'project_libnetconf'
readlink: illegal option -- f
usage: readlink [-n] [file ...]
src/internal.c:847:43: warning: passing 'gid_t *' (aka 'unsigned int *') to
parameter of type 'int *' converts between pointers to integer types with
different sign [-Wpointer-sign]
if (getgrouplist(username, pp->pw_gid, glist, &i...
^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/unistd.h:653:43: note:
passing argument to parameter here
int getgrouplist(const char *, int, int *, int *);
^
1 warning generated.
src/datastore.c:667:12: warning: unused function 'fmon_restore_file'
[-Wunused-function]
static int fmon_restore_file(const char* target)
^
src/datastore.c:683:12: warning: unused function 'fmon_backup_file' [-Wunused-function]
static int fmon_backup_file(const char* source)
^
2 warnings generated.
sed: 1: "s/@RNGLIB@//Users/khali ...": bad flag in substitute command: 'U'
[ 6%] Performing install step for 'project_libnetconf'
[ 7%] Completed 'project_libnetconf'
[ 7%] Built target project_libnetconf
Scanning dependencies of target project_libyang
[ 8%] Creating directories for 'project_libyang'
[ 9%] Performing download step (download, verify and extract) for 'project_libyang'
-- Downloading...
dst='/Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/project_libyang/src/master.zip'
timeout='none'
-- Using src='https://github.com/ygorelik/libyang/archive/master.zip'
-- Downloading... done
-- extracting...
src='/Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/project_libyang/src/master.zip'
dst='/Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/project_libyang/src/project_libyang'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 10%] No patch step for 'project_libyang'
[ 11%] No update step for 'project_libyang'
[ 11%] Performing configure step for 'project_libyang'
-- The C compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found FLEX: /usr/bin/flex (found version "2.5.35")
-- Found BISON: /usr/bin/bison (found version "2.3")
CMake Warning at CMakeLists.txt:134 (message):
Missing tools (devscripts, debhelper package) for building deb package.
You won't be able to generate deb package from source code.
Compiling libyang should still works fine.
CMake Warning at CMakeLists.txt:145 (message):
Missing tools (rpm package) for building rpm package.
You won't be able to generate rpm package from source code.
Compiling libyang should still works fine.
-- Found PCRE: /usr/local/lib/libpcre.dylib
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.15") found components: doxygen dot
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/project_libyang/src/project_libyang-build
[ 12%] Performing build step for 'project_libyang'
Scanning dependencies of target yang_static
[ 2%] Building C object CMakeFiles/yang_static.dir/src/common.c.o
In file included from /Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/project_libyang/src/project_libyang/src/common.c:29:
/Users/khalil/Desktop/ydk/ydk-gen/sdk/cpp/core/build/project_libyang/src/project_libyang/src/parser.h:18:10: fatal error:
'pcre.h' file not found
#include <pcre.h>
^~~~~~~~
1 error generated.
make[5]: *** [CMakeFiles/yang_static.dir/src/common.c.o] Error 1
make[4]: *** [CMakeFiles/yang_static.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [project_libyang/src/project_libyang-stamp/project_libyang-build] Error 2
make[1]: *** [CMakeFiles/project_libyang.dir/all] Error 2
make: *** [all] Error 2
01-21-2019 01:31 AM
01-21-2019 10:06 AM
01-21-2019 11:12 AM
I'm getting the same as before, even after having your comments checked.
The files path_api.hpp exists in /usr/local/ydk folder :/
01-21-2019 01:01 PM
This is wrong directory!! Not sure how did you get there.
Expected: /usr/local/include/ydk
You can try to move the ydk directory to correct path manually.
Yan
01-22-2019 12:16 AM - edited 01-22-2019 12:16 AM
I'm sorry, I just forgot to write the include folder in my previous comment. It is the right path, just checked it
07-14-2020 09:03 AM - edited 07-14-2020 09:03 AM
We're stuck on this path_api.hpp not found although it's present in /usr/local/include/ydk. It's a Mac. Help please.
01-22-2019 06:37 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide