1

我正在尝试在 python 3 中安装 SOAPpy 库。我收到以下错误

"/../Downloads/SOAPpy-0.11.6/SOAPpy/__init__.py", line 3, in <module>
    from version import __version__
ModuleNotFoundError: No module named 'version'

我尝试安装其他帖子中建议的其他替代方案,例如 zeep。但是我必须使用的 url 包含soap在其中,并且不能与其他替代方法一起使用。

以下是我从这里使用的示例脚本

#!/usr/bin/python
import string
import hashlib
from SOAPpy import WSDL ## for extracting the URL of the endpoint (server script) from the WSDL file
from SOAPpy import SOAPProxy ## for usage without WSDL file

#1) Usage with WSDL (for extracting the URL of the endpoint)
wsdl = "https://www.brenda-enzymes.org/soap/brenda.wsdl"
password = hashlib.sha256("myPassword").hexdigest()
client = WSDL.Proxy(wsdl)
parameters = "j.doe@example.edu,"+password+",ecNumber*1.1.1.1#organism*Homo sapiens#"
resultString = client.getKmValue(parameters)
print resultString

我想就如何解决这个问题征求建议。

4

1 回答 1

0

version 模块是 SOAPpy 包的一部分,但在 Python 3 中,您需要使用绝对导入,从 SOAPpy.version 导入版本init安装程序包文件中的.version 导入版本。代码也会有其他问题。

这是一个支持 SOAPpy for python3 https://pypi.org/project/SOAPpy-py3/的链接

于 2019-06-27T06:47:33.500 回答