Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'module' object has no attribute 'DefaultRoutingSearchParameters'

I have installed the ortools exactly as mentioned in this link.

After that, I copied vehicle routing problem from the documentation and tried to execute.I am using python 2.7.12 in my system.

I ended up with the below error:

   >>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'

Example problem link : https://developers.google.com/optimization/routing/tsp/vehicle_routing

like image 905
Neelesh I Avatar asked Jun 08 '26 19:06

Neelesh I


1 Answers

Based on the example from the repo, you can get default parameters like this instead:

 search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()
like image 186
Norrius Avatar answered Jun 10 '26 11:06

Norrius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!