FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
424 stars 138 forks source link

onvif.exceptions.ONVIFError: Unknown error: super() takes at least 1 argument (0 given) #33

Closed zqingxi closed 5 years ago

zqingxi commented 5 years ago

Hi, when installed onvif_zeep sucessfully, I ran the following code, but it throws ONVIFError:

>>> from onvif import ONVIFCamera
>>> mycam = ONVIFCamera('192.168.1.65', 80, 'admin', 'password', '/etc/onvif/wsdl/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 216, in __init__
    self.update_xaddrs()
  File "/usr/local/lib/python2.7/dist-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 223, in update_xaddrs
    self.devicemgmt  = self.create_devicemgmt_service()
  File "/usr/local/lib/python2.7/dist-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 333, in create_devicemgmt_service
    return self.create_onvif_service('devicemgmt', from_template)
  File "/usr/local/lib/python2.7/dist-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 321, in create_onvif_service
    transport=self.transport)
  File "/usr/local/lib/python2.7/dist-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 26, in wrapped
    raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: super() takes at least 1 argument (0 given)

the packages I installed are:

sudo pip install onvif
sudo pip install --upgrade onvif_zeep

and which I curious is : only install onvif, not install onvif_zeep , the code can run correctly, after install onvif_zeep, the problem occurs. Why ?

PS: when install onvif_zeep, I clone this repository, and run cd python-onvif-zeep & sudo python setup.py install, it failed. Then I try sudo pip install --upgrade onvif_zeep and it succeed. Why ?

Any help will be appreciated, thanks.

LuxunHuang commented 5 years ago

I have same problem too. When i use onvif-cli -u 'admin' -a '' --host '192.168.1.201' --port 8899 --wsdl ./python-onvif-zeep/wsdl/

get this error message: Traceback (most recent call last): File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/bin/onvif-cli", line 11, in <module> load_entry_point('onvif-zeep==0.2.12', 'console_scripts', 'onvif-cli')() File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/cli.py", line 159, in main cli.setup(args) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/cli.py", line 38, in setup args.wsdl, encrypt=args.encrypt) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 216, in __init__ self.update_xaddrs() File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 223, in update_xaddrs self.devicemgmt = self.create_devicemgmt_service() File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 333, in create_devicemgmt_service return self.create_onvif_service('devicemgmt', from_template) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 321, in create_onvif_service transport=self.transport) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 26, in wrapped raise ONVIFError(err) onvif.exceptions.ONVIFError: Unknown error: super() takes at least 1 argument (0 given)

zqingxi commented 5 years ago

I have same problem too. When i use onvif-cli -u 'admin' -a '' --host '192.168.1.201' --port 8899 --wsdl ./python-onvif-zeep/wsdl/

get this error message: Traceback (most recent call last): File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/bin/onvif-cli", line 11, in <module> load_entry_point('onvif-zeep==0.2.12', 'console_scripts', 'onvif-cli')() File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/cli.py", line 159, in main cli.setup(args) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/cli.py", line 38, in setup args.wsdl, encrypt=args.encrypt) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 216, in __init__ self.update_xaddrs() File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 223, in update_xaddrs self.devicemgmt = self.create_devicemgmt_service() File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 333, in create_devicemgmt_service return self.create_onvif_service('devicemgmt', from_template) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 321, in create_onvif_service transport=self.transport) File "/home/luxun/.local/share/virtualenvs/onvif_test-D5IzfeLC/local/lib/python2.7/site-packages/onvif_zeep-0.2.12-py2.7.egg/onvif/client.py", line 26, in wrapped raise ONVIFError(err) onvif.exceptions.ONVIFError: Unknown error: super() takes at least 1 argument (0 given)

Try to uninstall onvif_zeep, and install onvif only.

philsuth commented 5 years ago

I believe this error is due to a Python 2 incompatibility in client.py. I've submitted a pull request (#45) which should hopefully fix it for you.

zqingxi commented 5 years ago

Ok, thank you very much!

hongquan commented 5 years ago

I think it is 2019 now and you should not try to support Python 2. If some user wants to stay with Python 2, he/she can use https://pypi.org/project/onvif/. Don't drag python-onvif-zeep back. It will create a future problem of maintaining legacy code.

philsuth commented 5 years ago

@hongquan - In 7 short months and 20 something days I'll agree with you. :-)

However, right now at the top line of this project's code webpage it reads "ONVIF Client Implementation in Python 2+3 ...". I started using this module because of a number of issues I was having with the older module to which you refer, and because it was Python 2 only and I am preparing for a move of my apps to Python 3.

The trivial pull request I've made is perfectly legal Python 3 - it just uses the older Python 2 compatible syntax for a couple of super() calls. I agree entirely that Python 2 is almost at the end of its run, but you make this changeover easier for everyone by maintaining two way compatibility in the short term, particularly if the project description indicates compatibility with both languages.