Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

pip install libyang fails with exit code 2

Trying to install libyang but it gives me this error:

error: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe’ failed with exit code 2

I tried to uninstall and re install Visual studio build tools but it doesn’t seems to work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here is the full output:

U:\>pip install libyang
Looking in indexes: https://censored/api/pypi/pythonproxy/simple
Collecting libyang
  Using cached https://censored/api/pypi/pythonproxy/packages/packages/75/83/ef8afc344f6454a0d80cf2acae677a28de06150acb6084d55c6a71194408/libyang-2.8.0.tar.gz (55 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 c:\users\censored\appdata\local\programs\python\python311\lib\site-packages (from libyang) (1.15.1)
Requirement already satisfied: pycparser in c:\users\censored\appdata\local\programs\python\python311\lib\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.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\libyang
      copying libyang\context.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\data.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\diff.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\keyed_list.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\log.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\schema.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\util.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\xpath.py -> build\lib.win-amd64-cpython-311\libyang
      copying libyang\__init__.py -> build\lib.win-amd64-cpython-311\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.win-amd64-cpython-311\libyang
      copying libyang\py.typed -> build\lib.win-amd64-cpython-311\libyang
      running build_ext
      generating cffi module 'build\\temp.win-amd64-cpython-311\\Release\\_libyang.c'
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      building '_libyang' extension
      creating build\temp.win-amd64-cpython-311\Release\build
      creating build\temp.win-amd64-cpython-311\Release\build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release\build\temp.win-amd64-cpython-311\Release
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\censored\AppData\Local\Programs\Python\Python311\include -IC:\Users\censore\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcbuild\temp.win-amd64-cpython-311\Release\_libyang.c /Fobuild\temp.win-amd64-cpython-311\Release\build\temp.win-amd64-cpython-311\Release\_libyang.obj -Werror -std=c99
      clÿ: Ligne de commande error D8021ÿ: argument num‚rique non valide '/Werror'
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for libyang
Failed to build libyang
ERROR: Could not build wheels for libyang, which is required to install pyproject.toml-based projects

>Solution :

The project maintainer has said Windows is not supported. https://github.com/CESNET/libyang-python/issues/55#issuecomment-1307364421

You can try to use WSL2 on your machine instead to get a Linux environment available

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading