sr99622 / libonvif

Onvif library with GUI implementation and built in YOLOX
GNU Lesser General Public License v2.1
173 stars 44 forks source link

ImportError: DLL load failed while importing libonvif: The specified module could not be found. #88

Closed mriamnobody closed 7 months ago

mriamnobody commented 7 months ago

Platform Details

OS: Windows 11 Python: v3.10.7 cmake version 3.28.4 libonvif: Latest git cloned as mentioned in building guide for Windows

Issue

The building completes without any error but when I run the command python run.py I get the following error:

Traceback (most recent call last):
  File "F:\Projects\New folder\libonvif\onvif-gui\run.py", line 22, in <module>
    from gui import MainWindow
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\__init__.py", line 1, in <module>
    from .main import MainWindow
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\main.py", line 42, in <module>
    from gui.panels import CameraPanel, FilePanel, SettingsPanel, VideoPanel, AudioPanel
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\panels\__init__.py", line 1, in <module>
    from .camerapanel import CameraPanel
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\panels\camerapanel.py", line 26, in <module>
    from gui.onvif import NetworkTab, ImageTab, VideoTab, PTZTab, SystemTab, LoginDialog, \
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\onvif\__init__.py", line 7, in <module>
    from .datastructures import Session, StreamState, MediaSource, Camera
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\onvif\datastructures.py", line 25, in <module>
    import libonvif as onvif
  File "F:\Projects\New folder\enn\lib\site-packages\libonvif\__init__.py", line 19, in <module>
    sys.modules[name] = importlib.util.module_from_spec(spec)
ImportError: DLL load failed while importing libonvif: The specified module could not be found.

Below is the log from git cloning till the error:

(enn) F:\Projects\New folder>git clone --recursive https://github.com/sr99622/libonvif
Cloning into 'libonvif'...
remote: Enumerating objects: 4862, done.
remote: Counting objects: 100% (1947/1947), done.
remote: Compressing objects: 100% (711/711), done.
remote: Total 4862 (delta 1236), reused 1902 (delta 1212), pack-reused 2915
Receiving objects: 100% (4862/4862), 16.62 MiB | 17.37 MiB/s, done.
Resolving deltas: 100% (3160/3160), done.
Submodule 'libavio' (https://github.com/sr99622/libavio) registered for path 'libavio'
Submodule 'libonvif/pybind11' (https://github.com/pybind/pybind11) registered for path 'libonvif/pybind11'
Cloning into 'F:/Projects/New folder/libonvif/libavio'...
remote: Enumerating objects: 1814, done.
remote: Counting objects: 100% (686/686), done.
remote: Compressing objects: 100% (351/351), done.
remote: Total 1814 (delta 370), reused 627 (delta 329), pack-reused 1128
Receiving objects: 100% (1814/1814), 35.63 MiB | 16.70 MiB/s, done.
Resolving deltas: 100% (1174/1174), done.
Cloning into 'F:/Projects/New folder/libonvif/libonvif/pybind11'...
remote: Enumerating objects: 27815, done.
remote: Counting objects: 100% (565/565), done.
remote: Compressing objects: 100% (240/240), done.
remote: Total 27815 (delta 338), reused 468 (delta 285), pack-reused 27250
Receiving objects: 100% (27815/27815), 10.86 MiB | 7.29 MiB/s, done.
Resolving deltas: 100% (19616/19616), done.
Submodule path 'libavio': checked out '664f8d5dbb942dcc1eb526c05321bb634d77ea70'
Submodule 'pybind11' (https://github.com/pybind/pybind11) registered for path 'libavio/pybind11'
Cloning into 'F:/Projects/New folder/libonvif/libavio/pybind11'...
remote: Enumerating objects: 27815, done.
remote: Counting objects: 100% (565/565), done.
remote: Compressing objects: 100% (250/250), done.
remote: Total 27815 (delta 333), reused 463 (delta 275), pack-reused 27250
Receiving objects: 100% (27815/27815), 10.94 MiB | 21.14 MiB/s, done.
Resolving deltas: 100% (19513/19513), done.
Submodule path 'libavio/pybind11': checked out 'e53d58af6c0ade85fa6edce6a228ad2aeace55ee'
Submodule path 'libonvif/pybind11': checked out '19816f0db7b89468104f5ed284c0ec9d7e312c44'

(enn) F:\Projects\New folder>cd libonvif\libonvif

(enn) F:\Projects\New folder\libonvif\libonvif>pip install -v .
Using pip 22.2.2 from F:\Projects\New folder\enn\lib\site-packages\pip (python 3.10)
Processing f:\projects\new folder\libonvif\libonvif
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=61.0
    Downloading setuptools-69.5.1-py3-none-any.whl (894 kB)
       ------------------------------------- 894.6/894.6 kB 14.0 MB/s eta 0:00:00
  Installing collected packages: setuptools
  Successfully installed setuptools-69.5.1

  [notice] A new release of pip available: 22.2.2 -> 24.0
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  creating libonvif.egg-info
  writing libonvif.egg-info\PKG-INFO
  writing dependency_links to libonvif.egg-info\dependency_links.txt
  writing top-level names to libonvif.egg-info\top_level.txt
  writing manifest file 'libonvif.egg-info\SOURCES.txt'
  reading manifest file 'libonvif.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'libonvif.egg-info\SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting wheel
    Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
       ---------------------------------------- 65.8/65.8 kB 3.5 MB/s eta 0:00:00
  Installing collected packages: wheel
  Successfully installed wheel-0.43.0

  [notice] A new release of pip available: 22.2.2 -> 24.0
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info
  writing C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info\PKG-INFO
  writing dependency_links to C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info\dependency_links.txt
  writing top-level names to C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info\top_level.txt
  writing manifest file 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif.egg-info\SOURCES.txt'
  creating 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-ya2__xyt\libonvif-3.1.1.dist-info'
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: libonvif
  Running command Building wheel for libonvif (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\libonvif
  copying libonvif\__init__.py -> build\lib.win-amd64-cpython-310\libonvif
  running egg_info
  writing libonvif.egg-info\PKG-INFO
  writing dependency_links to libonvif.egg-info\dependency_links.txt
  writing top-level names to libonvif.egg-info\top_level.txt
  reading manifest file 'libonvif.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'libonvif.egg-info\SOURCES.txt'
  copying libonvif\libxml2.dll -> build\lib.win-amd64-cpython-310\libonvif
  copying libonvif\msvcp140.dll -> build\lib.win-amd64-cpython-310\libonvif
  copying libonvif\vcruntime140.dll -> build\lib.win-amd64-cpython-310\libonvif
  running build_ext
  -- Building for: Visual Studio 17 2022
  -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22631.
  -- The C compiler identification is MSVC 19.39.33523.0
  -- The CXX compiler identification is MSVC 19.39.33523.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - 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: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- pybind11 v2.11.0 dev1
  -- Found PythonInterp: C:/ProgramData/chocolatey/bin/python3.11.exe (found suitable version "3.11.5", minimum required is "3.6")
  -- Found PythonLibs: c:/python311/libs/python311.lib
  -- Performing Test HAS_MSVC_GL_LTCG
  -- Performing Test HAS_MSVC_GL_LTCG - Success
  -- LIBXML2_INCLUDE_DIRS: F:/Projects/New folder/libonvif/libonvif/libxml2/include/libxml2
  -- LIBXML2_LIBRARIES: F:/Projects/New folder/libonvif/libonvif/libxml2/lib/libxml2.lib
  -- Configuring done (5.6s)
  -- Generating done (0.1s)
  -- Build files have been written to: F:/Projects/New folder/libonvif/libonvif/build/temp.win-amd64-cpython-310/Release/libonvif
  MSBuild version 17.9.8+b34f75857 for .NET Framework

    1>Checking Build System
    Building Custom Rule F:/Projects/New folder/libonvif/libonvif/CMakeLists.txt
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libonvif\build\temp.win-amd64-cpython-310\Release\libonvif\pyonvif.vcxproj]
    onvif.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libonvif\build\temp.win-amd64-cpython-310\Release\libonvif\pyonvif.vcxproj]
    onvif.c
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libonvif\build\temp.win-amd64-cpython-310\Release\libonvif\pyonvif.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libonvif\build\temp.win-amd64-cpython-310\Release\libonvif\pyonvif.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libonvif\build\temp.win-amd64-cpython-310\Release\libonvif\pyonvif.vcxproj]
    cencode.c
    sha1.c
       Creating library F:/Projects/New folder/libonvif/libonvif/build/temp.win-amd64-cpython-310/Release/libonvif/Release/libonvif.lib and object F:/Projects/New folder/libonvif/libonvif/build/temp.win-amd64-cpython-310/Release/libonvif/Release/libonvif.exp
    Generating code
    Finished generating code
    pyonvif.vcxproj -> F:\Projects\New folder\libonvif\libonvif\build\lib.win-amd64-cpython-310\libonvif\libonvif.cp311-win_amd64.pyd
    Building Custom Rule F:/Projects/New folder/libonvif/libonvif/CMakeLists.txt
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\libonvif
  copying build\lib.win-amd64-cpython-310\libonvif\libonvif.cp311-win_amd64.pyd -> build\bdist.win-amd64\wheel\.\libonvif
  copying build\lib.win-amd64-cpython-310\libonvif\libxml2.dll -> build\bdist.win-amd64\wheel\.\libonvif
  copying build\lib.win-amd64-cpython-310\libonvif\msvcp140.dll -> build\bdist.win-amd64\wheel\.\libonvif
  copying build\lib.win-amd64-cpython-310\libonvif\vcruntime140.dll -> build\bdist.win-amd64\wheel\.\libonvif
  copying build\lib.win-amd64-cpython-310\libonvif\__init__.py -> build\bdist.win-amd64\wheel\.\libonvif
  running install_egg_info
  Copying libonvif.egg-info to build\bdist.win-amd64\wheel\.\libonvif-3.1.1-py3.10.egg-info
  running install_scripts
  C:\Users\rosha\AppData\Local\Temp\pip-build-env-cota0lgd\normal\Lib\site-packages\wheel\bdist_wheel.py:108: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
    if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
  creating build\bdist.win-amd64\wheel\libonvif-3.1.1.dist-info\WHEEL
  creating 'C:\Users\rosha\AppData\Local\Temp\pip-wheel-bbi7emrv\.tmp-df_uv1am\libonvif-3.1.1-cp310-cp310-win_amd64.whl' and adding 'build\bdist.win-amd64\wheel' to it
  adding 'libonvif/__init__.py'
  adding 'libonvif/libonvif.cp311-win_amd64.pyd'
  adding 'libonvif/libxml2.dll'
  adding 'libonvif/msvcp140.dll'
  adding 'libonvif/vcruntime140.dll'
  adding 'libonvif-3.1.1.dist-info/LICENSE'
  adding 'libonvif-3.1.1.dist-info/METADATA'
  adding 'libonvif-3.1.1.dist-info/WHEEL'
  adding 'libonvif-3.1.1.dist-info/top_level.txt'
  adding 'libonvif-3.1.1.dist-info/RECORD'
  removing build\bdist.win-amd64\wheel
  Building wheel for libonvif (pyproject.toml) ... done
  Created wheel for libonvif: filename=libonvif-3.1.1-cp310-cp310-win_amd64.whl size=1008593 sha256=15676d68407df7e366f61f18964b6028a38ae5e5392b811c2b3cead21f938810
  Stored in directory: C:\Users\rosha\AppData\Local\Temp\pip-ephem-wheel-cache-vfhis393\wheels\6b\c2\24\5979fadfb4edb885c8b77b2590d90de17e2bd32d8980f2d00a
Successfully built libonvif
Installing collected packages: libonvif
Successfully installed libonvif-3.1.1

[notice] A new release of pip available: 22.2.2 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip

(enn) F:\Projects\New folder\libonvif\libonvif>cd ..

(enn) F:\Projects\New folder\libonvif>cd libavio

(enn) F:\Projects\New folder\libonvif\libavio>pip install -v .
Using pip 22.2.2 from F:\Projects\New folder\enn\lib\site-packages\pip (python 3.10)
Processing f:\projects\new folder\libonvif\libavio
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=61.0
    Using cached setuptools-69.5.1-py3-none-any.whl (894 kB)
  Installing collected packages: setuptools
  Successfully installed setuptools-69.5.1

  [notice] A new release of pip available: 22.2.2 -> 24.0
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  creating avio.egg-info
  writing avio.egg-info\PKG-INFO
  writing dependency_links to avio.egg-info\dependency_links.txt
  writing top-level names to avio.egg-info\top_level.txt
  writing manifest file 'avio.egg-info\SOURCES.txt'
  reading manifest file 'avio.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'avio.egg-info\SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting wheel
    Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
  Installing collected packages: wheel
  Successfully installed wheel-0.43.0

  [notice] A new release of pip available: 22.2.2 -> 24.0
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info
  writing C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info\PKG-INFO
  writing dependency_links to C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info\dependency_links.txt
  writing top-level names to C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info\top_level.txt
  writing manifest file 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio.egg-info\SOURCES.txt'
  creating 'C:\Users\rosha\AppData\Local\Temp\pip-modern-metadata-qgioy7ic\avio-3.1.2.dist-info'
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: avio
  Running command Building wheel for avio (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\avio
  copying avio\__init__.py -> build\lib.win-amd64-cpython-310\avio
  running egg_info
  writing avio.egg-info\PKG-INFO
  writing dependency_links to avio.egg-info\dependency_links.txt
  writing top-level names to avio.egg-info\top_level.txt
  reading manifest file 'avio.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'avio.egg-info\SOURCES.txt'
  copying avio\SDL2.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\avcodec.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\avdevice.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\avfilter.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\avformat.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\avutil.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\postproc.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\swresample.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\swscale.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\vcomp140.dll -> build\lib.win-amd64-cpython-310\avio
  copying avio\vcruntime140.dll -> build\lib.win-amd64-cpython-310\avio
  running build_ext
  -- Building for: Visual Studio 17 2022
  -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22631.
  -- The C compiler identification is MSVC 19.39.33523.0
  -- The CXX compiler identification is MSVC 19.39.33523.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - 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: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found FFmpeg: F:/Projects/New folder/libonvif/libavio/ffmpeg/include;F:/Projects/New folder/libonvif/libavio/ffmpeg/include;F:/Projects/New folder/libonvif/libavio/ffmpeg/include;F:/Projects/New folder/libonvif/libavio/ffmpeg/include;F:/Projects/New folder/libonvif/libavio/ffmpeg/include;F:/Projects/New folder/libonvif/libavio/ffmpeg/include
  -- Found SDL2: F:/Projects/New folder/libonvif/libavio/sdl/include/SDL
  -- pybind11 v2.11.0 dev1
  -- Found PythonInterp: C:/ProgramData/chocolatey/bin/python3.11.exe (found suitable version "3.11.5", minimum required is "3.6")
  -- Found PythonLibs: c:/python311/libs/python311.lib
  -- Performing Test HAS_MSVC_GL_LTCG
  -- Performing Test HAS_MSVC_GL_LTCG - Success
  -- Configuring done (5.8s)
  -- Generating done (0.1s)
  -- Build files have been written to: F:/Projects/New folder/libonvif/libavio/build/temp.win-amd64-cpython-310/Release/avio
  MSBuild version 17.9.8+b34f75857 for .NET Framework

    1>Checking Build System
    Building Custom Rule F:/Projects/New folder/libonvif/libavio/CMakeLists.txt
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    avio.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    Clock.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    Decoder.cpp
    Display.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    Encoder.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    Exception.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    Filter.cpp
    Frame.cpp
    Packet.cpp
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
  cl : command line  warning D9025: overriding '/W1' with '/w' [F:\Projects\New folder\libonvif\libavio\build\temp.win-amd64-cpython-310\Release\avio\avio.vcxproj]
    Pipe.cpp
    Player.cpp
    Reader.cpp
    Writer.cpp
       Creating library F:/Projects/New folder/libonvif/libavio/build/temp.win-amd64-cpython-310/Release/avio/Release/avio.lib and object F:/Projects/New folder/libonvif/libavio/build/temp.win-amd64-cpython-310/Release/avio/Release/avio.exp
    Generating code
    Finished generating code
    avio.vcxproj -> F:\Projects\New folder\libonvif\libavio\build\lib.win-amd64-cpython-310\avio\avio.cp311-win_amd64.pyd
    Building Custom Rule F:/Projects/New folder/libonvif/libavio/CMakeLists.txt
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\avio
  copying build\lib.win-amd64-cpython-310\avio\avcodec.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\avdevice.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\avfilter.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\avformat.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\avio.cp311-win_amd64.pyd -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\avutil.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\postproc.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\SDL2.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\swresample.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\swscale.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\vcomp140.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\vcruntime140.dll -> build\bdist.win-amd64\wheel\.\avio
  copying build\lib.win-amd64-cpython-310\avio\__init__.py -> build\bdist.win-amd64\wheel\.\avio
  running install_egg_info
  Copying avio.egg-info to build\bdist.win-amd64\wheel\.\avio-3.1.2-py3.10.egg-info
  running install_scripts
  C:\Users\rosha\AppData\Local\Temp\pip-build-env-z883nyul\normal\Lib\site-packages\wheel\bdist_wheel.py:108: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
    if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
  creating build\bdist.win-amd64\wheel\avio-3.1.2.dist-info\WHEEL
  creating 'C:\Users\rosha\AppData\Local\Temp\pip-wheel-h2_9odba\.tmp-zy5g8_w9\avio-3.1.2-cp310-cp310-win_amd64.whl' and adding 'build\bdist.win-amd64\wheel' to it
  adding 'avio/SDL2.dll'
  adding 'avio/__init__.py'
  adding 'avio/avcodec.dll'
  adding 'avio/avdevice.dll'
  adding 'avio/avfilter.dll'
  adding 'avio/avformat.dll'
  adding 'avio/avio.cp311-win_amd64.pyd'
  adding 'avio/avutil.dll'
  adding 'avio/postproc.dll'
  adding 'avio/swresample.dll'
  adding 'avio/swscale.dll'
  adding 'avio/vcomp140.dll'
  adding 'avio/vcruntime140.dll'
  adding 'avio-3.1.2.dist-info/LICENSE'
  adding 'avio-3.1.2.dist-info/METADATA'
  adding 'avio-3.1.2.dist-info/WHEEL'
  adding 'avio-3.1.2.dist-info/top_level.txt'
  adding 'avio-3.1.2.dist-info/RECORD'
  removing build\bdist.win-amd64\wheel
  Building wheel for avio (pyproject.toml) ... done
  Created wheel for avio: filename=avio-3.1.2-cp310-cp310-win_amd64.whl size=21781175 sha256=0e7bc31bf41300ba5daba25c27cd53e0e6794bf8eeec61fbde1b5edf8b051a7c
  Stored in directory: C:\Users\rosha\AppData\Local\Temp\pip-ephem-wheel-cache-erwr_u2z\wheels\63\6a\1a\2c5714d700b85e592b6156703a28cbdae454547cba62d3f730
Successfully built avio
Installing collected packages: avio
Successfully installed avio-3.1.2

[notice] A new release of pip available: 22.2.2 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip

(enn) F:\Projects\New folder\libonvif\libavio>cd ..

(enn) F:\Projects\New folder\libonvif>cd onvif-gui

(enn) F:\Projects\New folder\libonvif\onvif-gui>pip install onvif-gui
Collecting onvif-gui
  Downloading onvif_gui-2.0.9-py3-none-any.whl (508 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 508.4/508.4 kB 7.9 MB/s eta 0:00:00
Requirement already satisfied: libonvif==3.1.1 in f:\projects\new folder\enn\lib\site-packages (from onvif-gui) (3.1.1)
Collecting pyqt6==6.6.1
  Downloading PyQt6-6.6.1-cp38-abi3-win_amd64.whl (6.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 46.4 MB/s eta 0:00:00
Collecting opencv-python
  Downloading opencv_python-4.9.0.80-cp37-abi3-win_amd64.whl (38.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 MB 17.7 MB/s eta 0:00:00
Collecting numpy
  Downloading numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.8/15.8 MB 20.5 MB/s eta 0:00:00
Requirement already satisfied: avio==3.1.2 in f:\projects\new folder\enn\lib\site-packages (from onvif-gui) (3.1.2)
Collecting loguru
  Downloading loguru-0.7.2-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 kB 3.5 MB/s eta 0:00:00
Collecting PyQt6-Qt6==6.6.1
  Downloading PyQt6_Qt6-6.6.1-py3-none-win_amd64.whl (62.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.2/62.2 MB 23.3 MB/s eta 0:00:00
Collecting PyQt6-sip<14,>=13.6
  Downloading PyQt6_sip-13.6.0-cp310-cp310-win_amd64.whl (72 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.8/72.8 kB ? eta 0:00:00
Collecting win32-setctime>=1.0.0
  Downloading win32_setctime-1.1.0-py3-none-any.whl (3.6 kB)
Collecting colorama>=0.3.4
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Installing collected packages: PyQt6-Qt6, win32-setctime, PyQt6-sip, numpy, colorama, pyqt6, opencv-python, loguru, onvif-gui
Successfully installed PyQt6-Qt6-6.6.1 PyQt6-sip-13.6.0 colorama-0.4.6 loguru-0.7.2 numpy-1.26.4 onvif-gui-2.0.9 opencv-python-4.9.0.80 pyqt6-6.6.1 win32-setctime-1.1.0

[notice] A new release of pip available: 22.2.2 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip

(enn) F:\Projects\New folder\libonvif\onvif-gui>python run.py
Traceback (most recent call last):
  File "F:\Projects\New folder\libonvif\onvif-gui\run.py", line 22, in <module>
    from gui import MainWindow
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\__init__.py", line 1, in <module>
    from .main import MainWindow
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\main.py", line 42, in <module>
    from gui.panels import CameraPanel, FilePanel, SettingsPanel, VideoPanel, AudioPanel
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\panels\__init__.py", line 1, in <module>
    from .camerapanel import CameraPanel
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\panels\camerapanel.py", line 26, in <module>
    from gui.onvif import NetworkTab, ImageTab, VideoTab, PTZTab, SystemTab, LoginDialog, \
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\onvif\__init__.py", line 7, in <module>
    from .datastructures import Session, StreamState, MediaSource, Camera
  File "F:\Projects\New folder\libonvif\onvif-gui\gui\onvif\datastructures.py", line 25, in <module>
    import libonvif as onvif
  File "F:\Projects\New folder\enn\lib\site-packages\libonvif\__init__.py", line 19, in <module>
    sys.modules[name] = importlib.util.module_from_spec(spec)
ImportError: DLL load failed while importing libonvif: The specified module could not be found.
mriamnobody commented 7 months ago

Hello Stephen, I went over the logs slowly and very carefully, and found some discrepancies between thePython and Windows SDK versions. I was using Python 3.10.7, but the script selected or was using the Python interpreter and Pythonlibs 3.11.X:

-- Found PythonInterp: C:/ProgramData/chocolatey/bin/python3.11.exe (found suitable version "3.11.5", minimum required is "3.6")

Found PythonLibs: c:/python311/libs/python311.lib

I switched to Python 3.11.X and also updated Windows SDK from 10.0.22000.0 to 10.0.22621.0

Above changes solved the issue for me.

sr99622 commented 7 months ago

Hello, glad to hear you were able to get things working. I have read that the multiple python version problem is a common issue. I think it starts with the cmake auto find feature that discovers the python library on the host computer when preparing to compile. The search algorithm is pretty opaque, so it sometimes produces unexpected results. Using a python virtual environment might help eliminate some of the confusion, as there would only be one python executable within the environment for cmake to find.

On Wed, Apr 17, 2024 at 7:22 AM Roshanlal @.***> wrote:

Hello Stephen, I went over the logs slowly and very carefully, and found some discrepancies between the Python and Windows SDK versions. I was using Python 3.10.7, but the script selected or was using the Python interpreter and Pythonlibs 3.11.X:

-- Found PythonInterp: C:/ProgramData/chocolatey/bin/python3.11.exe (found suitable version "3.11.5", minimum required is "3.6")

Found PythonLibs: c:/python311/libs/python311.lib

I switched to Python 3.11.X and also updated Windows SDK from 10.0.22000.0 to 10.0.22621.0

Above changes solved the issue for me.

— Reply to this email directly, view it on GitHub https://github.com/sr99622/libonvif/issues/88#issuecomment-2061032257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6EKOCYGAHGEGF62KVSUE3Y5ZLPXAVCNFSM6AAAAABGKYJTTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRRGAZTEMRVG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>