简体   繁体   English

OData示例不起作用(Python)

[英]OData example not working (Python)

I'm running this code that I got from here 我正在运行从这里获得的代码

https://tuomur-python-odata.readthedocs.io/en/latest/#what-is-this https://tuomur-python-odata.readthedocs.io/en/latest/#what-is-this

from odata import ODataService
url = 'http://services.odata.org/V4/Northwind/Northwind.svc/'
Service = ODataService(url, reflect_entities=True)
Order = Service.entities['Order']
query = Service.query(Order)
query = query.filter(Order.Name.startswith('Demo'))
query = query.order_by(Order.ShippedDate.desc())
for order in query:
    print(order.Name)

When I run the code, it says ImportError: No module named odata . 当我运行代码时,它说ImportError:没有名为odata的模块 I tried using pip install odata , nothing was found. 我尝试使用pip install odata ,未找到任何内容。 How do I install this library? 如何安装此库? I can't find any documentation on how to install it either. 我也找不到任何有关如何安装它的文档。

从GitHub下载项目,如有必要,运行python setup.py install ,sudo。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM