Skip to content

library not found for -lyang on macOS 13.1 #59

Description

@TribuneX

Hi,

I used this binding with libyang 1.x on previous macOS versions. However, I can't get it installed with the latest macOS Ventura Release 13.1:

pip install libyang                                 
Collecting libyang
  Using cached libyang-2.6.0.tar.gz (45 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi in ./.venv/lib/python3.10/site-packages (from libyang) (1.15.0)
Requirement already satisfied: pycparser in ./.venv/lib/python3.10/site-packages (from cffi->libyang) (2.21)
Building wheels for collected packages: libyang
  Building wheel for libyang (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for libyang (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-13-arm64-cpython-310
      creating build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/log.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/util.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/__init__.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/context.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/xpath.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/diff.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/keyed_list.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/data.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/schema.py -> build/lib.macosx-13-arm64-cpython-310/libyang
      running egg_info
      writing libyang.egg-info/PKG-INFO
      writing dependency_links to libyang.egg-info/dependency_links.txt
      writing requirements to libyang.egg-info/requires.txt
      writing top-level names to libyang.egg-info/top_level.txt
      reading manifest file 'libyang.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'libyang.egg-info/SOURCES.txt'
      copying libyang/VERSION -> build/lib.macosx-13-arm64-cpython-310/libyang
      copying libyang/py.typed -> build/lib.macosx-13-arm64-cpython-310/libyang
      running build_ext
      generating cffi module 'build/temp.macosx-13-arm64-cpython-310/_libyang.c'
      creating build/temp.macosx-13-arm64-cpython-310
      building '_libyang' extension
      creating build/temp.macosx-13-arm64-cpython-310/build
      creating build/temp.macosx-13-arm64-cpython-310/build/temp.macosx-13-arm64-cpython-310
      /opt/homebrew/Cellar/gcc/12.2.0/bin/gcc-12 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I/Users/mac/gitlab/network-orchestrator/.venv/include -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c build/temp.macosx-13-arm64-cpython-310/_libyang.c -o build/temp.macosx-13-arm64-cpython-310/build/temp.macosx-13-arm64-cpython-310/_libyang.o -Werror -std=c99
      /opt/homebrew/Cellar/gcc/12.2.0/bin/gcc-12 -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk build/temp.macosx-13-arm64-cpython-310/build/temp.macosx-13-arm64-cpython-310/_libyang.o -lyang -o build/lib.macosx-13-arm64-cpython-310/_libyang.cpython-310-darwin.so
      ld: library not found for -lyang
      collect2: error: ld returned 1 exit status
      error: command '/opt/homebrew/Cellar/gcc/12.2.0/bin/gcc-12' failed with exit code 1
      [end of output]

Same issue while trying to install libyang v1.7.0 together with libyang 1.X. Any suggestions how to address:

ld: library not found for -lyang

Both gcc-12 and clang fail with this issue.

Activity

  1. changed the title [-]Install issues on macOS Ventura 13.1[/-] [+]library not found for -lyang on macOS 13.1[/+] on Jan 2, 2023
  2. TribuneX commented on Jan 30, 2023

    @TribuneX
    Author

    Got it working. I missed the following export before installing this python binding:

    export LIBRARY_PATH=/usr/local/lib
    

    I was also able to install libyang v1.x with gcc-12 and clang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions