buresu / ndi-python

NewTek NDI Python wrapper
MIT License
133 stars 30 forks source link

Installation for Python 3.11? #31

Open OPerepadia opened 1 year ago

OPerepadia commented 1 year ago

Hi, I encountered an issue while installing this package on Arch Linux with Python 3.11.3. The installation fails with the following output:

$ pip3 install ndi-python
Defaulting to user installation because normal site-packages is not writeable
Collecting ndi-python
  Using cached ndi-python-5.1.1.1.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /usr/lib/python3.11/site-packages (from ndi-python) (1.24.3)
Building wheels for collected packages: ndi-python
  Building wheel for ndi-python (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [36 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/NDIlib
      copying NDIlib/__init__.py -> build/lib.linux-x86_64-cpython-311/NDIlib
      running build_ext
      cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/pip-install-pqore8mz/ndi-python_d1f9a3e91bdf4ed18a7998572c4cb231/build/install
      -- The C compiler identification is GNU 13.1.1
      -- The CXX compiler identification is GNU 13.1.1
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /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: /usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Error at CMakeLists.txt:10 (add_subdirectory):
        add_subdirectory given source "lib/pybind11" which is not an existing
        directory.

      CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find NDI (missing: NDI_DIR FALSE)
      Call Stack (most recent call first):
        /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
        cmake/Modules/FindNDI.cmake:45 (find_package_handle_standard_args)
        CMakeLists.txt:12 (find_package)

      -- Configuring incomplete, errors occurred!
      error: command '/usr/bin/cmake' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ndi-python
  Running setup.py clean for ndi-python
Failed to build ndi-python
ERROR: Could not build wheels for ndi-python, which is required to install pyproject.toml-based projects
OPerepadia commented 1 year ago

The solution is to build the package from source using instructions from readme. After that, it can be installed like this:

cd dist
pip install ndi_python-5.1.1.5-cp311-cp311-linux_x86_64.whl

Here is the binary if anyone needs it

ndi_python-5.1.1.5-cp311-cp311-linux_x86_64.tar.gz

rastinder commented 1 year ago

for windows after building from source copy '\build\lib.win-amd64-cpython-311\NDIlib" folder in 'C:\Program Files\Python311\Lib\site-packages'

drmbt commented 2 months ago

has anyone verified getting this to work in python 3.11 on windows?