ImportError: cannot import name 'Client' from 'zeep'

Viewed 3372

I need to work with API via wsdl and I'm trying to figure out how zeep module works. The module was installed with "pip install" and it shows the same error every time.

ImportError: cannot import name 'Client' from 'zeep'

from zeep import Client

client = Client('http://www.webservicex.net/ConvertSpeed.asmx?WSDL')
result = client.service.ConvertSpeed(
    100, 'kilometersPerhour', 'milesPerhour')

assert result == 62.137 ```
2 Answers

First of all, do a pip freeze and make sure that zeep is installed.

If it's installed then make sure your source file is not named zeep.py or it will not work.

[edit]

From someone else on Github: "And ensure there's no zeep.pyc in the folder"

This leads me to believe that there should be no source file with the name zeep in the folder.

Link to GitHub discussion

You need to set permissions on the zeep library. Set permissions on the library directory in the site-packages directory.

chmod -R 777 zeep
Related