python-onvif-zeep
python-onvif-zeep copied to clipboard
Error: 'onvif.exceptions.ONVIFError: Unknown error: No such file: /usr/local/lib/python2.7/dist-packages/wsdl/devicemgmt.wsdl'
Hello,
if I try to call mycam = ONVIFCamera('192.168.1.100', 80, 'admin', 'admin)
I get No such file: /usr/local/lib/python2.7/dist-packages/wsdl/devicemgmt.wsdl'
- If I understand it correctly the wsdl files should be included in the PyPi package right?
If I download the wsdl files manually and add it to the call it works as expected.
Thanks in Advance!
It went out that the files are stored in usr/local/wsdl/
- It is a bug in the Code or a bug in the PyPi package?
ADD this parameter in class initialization for OnvifCamera
wsdl_dir='/usr/local/lib/python3.6/site-packages/wsdl
When I install python-onvif-zeep v0.2.12 from source as described in the README, eg
git checkout v0.2.12
python3 setup.py install
it installs these files:
-
/usr/local/lib/python3.8/dist-packages/onvif_zeep-0.2.12-py3.8.egg/onvif/client.py
-
/usr/local/lib/python3.8/dist-packages/onvif_zeep-0.2.12-py3.8.egg/lib/python3.8/site-packages/wsdl/devicemgmt.wsdl
and instantiating an ONVIFCamera
works without specifying a wsdl_dir
parameter.
When I instead use pip3 install onvif_zeep
(which downloads the latest version, v0.2.12, from pypi) similar to what's described slightly lower in the README, it installs these files:
-
/usr/local/lib/python3.8/dist-packages/onvif/client.py
-
/usr/local/lib/python3.8/site-packages/wsdl/devicemgmt.wsdl
and instantiating an ONVIFCamera
fails unless I override wsdl_dir
. It tries to open /usr/local/lib/python3.8/dist-packages/wsdl/devicemgmt.wsdl
, which doesn't exist.
I suspect this is pretty easy to fix (this guide suggests using package_data
rather than data_files
) but I'm not sure how to test it. I don't know how to get the pip-like installation without actually uploading something to pypi. I tried pip3 install .
and it did the same thing as python3 setup.py install
. Help, anyone?