08-17-2020 10:16 AM
Hello team, this seems to be an old issue but I could not find a solution on this forum besides moving the ydk to a linux machine instead of a Mac OS, it would be good if there was a solution to this.
I have followed all pre-req documented on http://ydk.cisco.com/py/docs/getting_started.html#system-requirements but still getting an error when trying to install ydk package on Mac OS:
DFELIXDA-M-X0YC:~ dfelixda$ pip3 install ydk Collecting ydk Using cached ydk-0.8.4.tar.gz (33 kB) Requirement already satisfied: pybind11>=2.1.1 in /usr/local/lib/python3.8/site-packages (from ydk) (2.5.0) Building wheels for collected packages: ydk Building wheel for ydk (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/setup.py'"'"'; __file__='"'"'/private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-wheel-axlejbai cwd: /private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/ Complete output (104 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.14-x86_64-3.8 creating build/lib.macosx-10.14-x86_64-3.8/ydk copying ydk/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk copying ydk/exthook.py -> build/lib.macosx-10.14-x86_64-3.8/ydk creating build/lib.macosx-10.14-x86_64-3.8/ydk/filters copying ydk/filters/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/filters creating build/lib.macosx-10.14-x86_64-3.8/ydk/types copying ydk/types/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/types copying ydk/types/py_types.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/types creating build/lib.macosx-10.14-x86_64-3.8/ydk/_core copying ydk/_core/_importer.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/_core copying ydk/_core/_dm_meta_info.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/_core copying ydk/_core/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/_core creating build/lib.macosx-10.14-x86_64-3.8/ydk/providers copying ydk/providers/netconf_provider.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/providers copying ydk/providers/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/providers copying ydk/providers/codec_provider.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/providers creating build/lib.macosx-10.14-x86_64-3.8/ydk/path copying ydk/path/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/path creating build/lib.macosx-10.14-x86_64-3.8/ydk/ext copying ydk/ext/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/ext creating build/lib.macosx-10.14-x86_64-3.8/ydk/entity_utils copying ydk/entity_utils/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/entity_utils copying ydk/entity_utils/entity_utils.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/entity_utils creating build/lib.macosx-10.14-x86_64-3.8/ydk/models copying ydk/models/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/models creating build/lib.macosx-10.14-x86_64-3.8/ydk/errors copying ydk/errors/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/errors copying ydk/errors/error_handler.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/errors creating build/lib.macosx-10.14-x86_64-3.8/ydk/logging copying ydk/logging/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/logging creating build/lib.macosx-10.14-x86_64-3.8/ydk/services copying ydk/services/netconf_service.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/services copying ydk/services/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/services copying ydk/services/executor_service.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/services copying ydk/services/crud_service.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/services copying ydk/services/codec_service.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/services creating build/lib.macosx-10.14-x86_64-3.8/ydk/path/sessions copying ydk/path/sessions/netconf_session.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/path/sessions copying ydk/path/sessions/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/path/sessions copying ydk/path/sessions/restconf_session.py -> build/lib.macosx-10.14-x86_64-3.8/ydk/path/sessions running build_ext -- The C compiler identification is AppleClang 10.0.1.10010046 -- The CXX compiler identification is AppleClang 10.0.1.10010046 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done python version: 3.8 -- Found PythonLibs: /usr/local/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib (found version "3.8.5") pybind11 include: /usr/local/lib/python3.8/site-packages/pybind11/include;/usr/local/lib/python3.8/site-packages/pybind11/include -- Configuring done -- Generating done -- Build files have been written to: /private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/build/temp.macosx-10.14-x86_64-3.8 Scanning dependencies of target ydk_ [ 50%] Building CXX object CMakeFiles/ydk_.dir/python.cpp.o /private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/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/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/setup.py", line 111, in <module> setup( File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup return distutils.core.setup(**attrs) File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 223, in run self.run_command('build') File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/setup.py", line 68, in run self.build_extension(ext) File "/private/var/folders/7_/65p28bss3txdfm60vb6vc_0h0000gn/T/pip-install-0w_pqw1j/ydk/setup.py", line 101, in build_extension subprocess.check_call([cmake_executable, '--build', '.'], cwd=self.build_temp) File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2. ---------------------------------------- ERROR: Failed building wheel for ydk Running setup.py clean for ydk Failed to build ydk
The error seems related to this file:
#include <ydk/path_api.hpp>
But I have checked and it is present o the correct directory:
DFELIXDA-M-X0YC:~ dfelixda$ cd /usr/local/include/ydk DFELIXDA-M-X0YC:ydk dfelixda$ ls capabilities_parser.hpp gnmi_client.hpp network_topology.hpp codec_provider.hpp gnmi_path_api.hpp opendaylight_parser.hpp codec_service.hpp gnmi_provider.hpp opendaylight_provider.hpp common_utilities.hpp gnmi_service.hpp path_api.hpp crud_service.hpp gnmi_util.hpp restconf_client.hpp entity_data_node_walker.hpp ietf_parser.hpp restconf_provider.hpp entity_lookup.hpp json.hpp service_provider.hpp entity_util.hpp logger.hpp types.hpp errors.hpp logging_callback.hpp validation_service.hpp executor_service.hpp netconf_client.hpp xml_subtree_codec.hpp filters.hpp netconf_model_provider.hpp xml_util.hpp gnmi.grpc.pb.h netconf_provider.hpp ydk.h gnmi.pb.h netconf_service.hpp ydk_gnmi.h DFELIXDA-M-X0YC:ydk dfelixda$
I have tried building the libydk myself with same error.
Thanks
Daniel
Solved! Go to Solution.
08-19-2020 10:35 AM
I am also running YDK on MacOS Mojave. Honestly, it was not easy to make it work.
First of all you need install YDK core library from source, because libydk package located in artifactory was built on Sierra (10.12), which uses older C/C++ compiler clang-8. Therefore I am not sure if that package will be fully compatible with clang-10 in Mojave. It is though worth trying for the YDK community benefits.
Second. Based on the error, the cmake cannot find YDK C++ header file ydk/path_api.hpp. This case has been documented here. Assuming that you have successfully installed the YDK core package, you need to define couple of environment variables to help cmake to find the header files:
export C_INCLUDE_PATH=/usr/local/include export CPLUS_INCLUDE_PATH=/usr/local/include
08-19-2020 10:35 AM
I am also running YDK on MacOS Mojave. Honestly, it was not easy to make it work.
First of all you need install YDK core library from source, because libydk package located in artifactory was built on Sierra (10.12), which uses older C/C++ compiler clang-8. Therefore I am not sure if that package will be fully compatible with clang-10 in Mojave. It is though worth trying for the YDK community benefits.
Second. Based on the error, the cmake cannot find YDK C++ header file ydk/path_api.hpp. This case has been documented here. Assuming that you have successfully installed the YDK core package, you need to define couple of environment variables to help cmake to find the header files:
export C_INCLUDE_PATH=/usr/local/include export CPLUS_INCLUDE_PATH=/usr/local/include
08-19-2020 12:29 PM
Thank you my friend... it has worked now...
As reference to anyone else with this issue, I have manually installed ydk from its source at:
https://github.com/CiscoDevNet/ydk-gen
Then just include the paths.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: