paulgb / penkit

Tools for pen plotting in Python
MIT License
142 stars 8 forks source link

RuntimeError: SWIG std::function invocation failed. #2

Open yratof opened 6 years ago

yratof commented 6 years ago

Hitting an error whenever i'm not using greedy:

Initial cost: 1175670.59166
Cost after greedy optimization: 51105.4291514
Traceback (most recent call last):
  File "/usr/local/bin/penkit-optimize", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/penkit_optimize/cli.py", line 79, in main
    run_optimizer(**vars(args))
  File "/usr/local/lib/python2.7/site-packages/penkit_optimize/cli.py", line 33, in run_optimizer
    vrp_solution = vrp_solver(path_graph, greedy_solution, runtime)
  File "/usr/local/lib/python2.7/site-packages/penkit_optimize/vrp_solver.py", line 58, in vrp_solver
    search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()
RuntimeError: SWIG std::function invocation failed.

Any ideas to why invocation failed?

paulgb commented 6 years ago

Hi @yratof, sorry for the slow reply, I was away. What OS are you using, and how did you install or-tools?

Thanks

yratof commented 6 years ago

macOS and via pip. Possibly attempted via brew too, but I don’t believe had any luck finding it

paulgb commented 6 years ago

Hmm, that should work (I'm using the same setup) -- might be a version mismatch.

What do you get if you run pip freeze | grep ortools?

Here's my output:

~/Projects/penkit/optimizer: pip freeze | grep ortools
ortools==6.7.4973
ortools-examples==6.4.4495
yratof commented 6 years ago

[yratof@eve:~] % pip freeze | grep ortools 1 ↵ ortools==6.7.4973

Looking like the same version

On 20 Jul 2018, at 13:10, Paul Butler notifications@github.com wrote:

Hmm, that should work (I'm using the same setup) -- might be a version mismatch.

What do you get if you run pip freeze | grep ortools?

Here's my output:

~/Projects/penkit/optimizer: pip freeze | grep ortools ortools==6.7.4973 ortools-examples==6.4.4495 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/paulgb/penkit/issues/2#issuecomment-406569870, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9Jz-lkvWNF3UupASLk9vGVuf_uPvpnks5uIbqagaJpZM4VGIBa.