gpt4 book ai didi

python - 属性错误 : 'module' object has no attribute 'DefaultRoutingSearchParameters'

转载 作者:太空宇宙 更新时间:2023-11-03 14:48:31 26 4
gpt4 key购买 nike

我已经完全按照 this 中的说明安装了 ortools链接。

之后,我从文档中复制了车辆路径问题并尝试执行。我在我的系统中使用的是 python 2.7.12。

我最终遇到了以下错误:

   >>python or_test.py 
Traceback (most recent call last):
File "or_test.py", line 120, in <module>
main()
File "or_test.py", line 52, in main
search_parameters = pywrapcp.DefaultRoutingSearchParameters()
AttributeError: 'module' object has no attribute
'DefaultRoutingSearchParameters'

示例问题链接: https://developers.google.com/optimization/routing/tsp/vehicle_routing

最佳答案

基于example from the repo ,您可以获得这样的默认参数:

 search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()

关于python - 属性错误 : 'module' object has no attribute 'DefaultRoutingSearchParameters' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47738916/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com