sr99622 / libonvif

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

AttributeError: module 'libonvif' has no attribute 'Data' #67

Closed SonNNguyen closed 1 year ago

SonNNguyen commented 1 year ago

Hello guys, after following installation guide Ubuntu 22, I got this can you help!

Traceback (most recent call last): File "/home/Desktop/Code/source/libonvif/onvif-gui/run.py", line 27, in from gui import MainWindow File "/home/Desktop/Code/source/libonvif/onvif-gui/gui/init.py", line 1, in from .main import MainWindow File "/home/Desktop/Code/source/libonvif/onvif-gui/gui/main.py", line 37, in from gui.panels import CameraPanel, FilePanel, SettingsPanel, VideoPanel, AudioPanel File "/home/Desktop/Code/source/libonvif/onvif-gui/gui/panels/init.py", line 1, in from .camerapanel import CameraPanel File "/home/Desktop/Code/source/libonvif/onvif-gui/gui/panels/camerapanel.py", line 31, in class CameraPanelSignals(QObject): File "/home/Desktop/Code/source/libonvif/onvif-gui/gui/panels/camerapanel.py", line 32, in CameraPanelSignals fill = pyqtSignal(onvif.Data) AttributeError: module 'libonvif' has no attribute 'Data'

sr99622 commented 1 year ago

I have seen this error in the past, I don't recall the exact conditions, but I think it means something is missing. The missing piece belongs to the libonvif python module, and may be the libxml2-dev installation. You could try the installation from source in verbose mode and see if you get a more descriptive error message.

sudo apt install git cmake g++ python3-pip libxml2-dev libavdevice-dev libsdl2-dev '^libxcb.*-dev' libxkbcommon-x11-dev

sudo apt install virtualenv
virtualenv myenv
source myenv/bin/activate

git clone --recursive https://github.com/sr99622/libonvif

cd libonvif/libonvif
pip install -v .
cd ../libavio
pip install  -v .
cd ../onvif-gui
pip install  -v .
SonNNguyen commented 1 year ago

@sr99622 Thank you for your reply this is what I got!

But I checked on several cases regarding of the import of cmake (install via pip) on internet but no found solution. Do you have any recommendation? I did try re-install things multiple times. and the import of cmake is ok if I do it separately


Building wheels for collected packages: libonvif
  Running command Building wheel for libonvif (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  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'
  running build_ext
  Traceback (most recent call last):
    File "/home/doctorson/Desktop/Code/source/libonvif/.env/bin/cmake", line 5, in <module>
      from cmake import cmake
  ModuleNotFoundError: No module named 'cmake'
  Traceback (most recent call last):
    File "/home/doctorson/Desktop/Code/source/libonvif/.env/bin/cmake", line 5, in <module>
      from cmake import cmake
  ModuleNotFoundError: No module named 'cmake'
SonNNguyen commented 1 year ago

@sr99622

Oh I found it. Turns out I need to set correct PATH to /usr/bin/cmake instead of the cmake installed from pip.