[constraint_solver/unix/python] google3 dependencies for generated swig files

344 views
Skip to first unread message

Ryan Leary

unread,
Nov 10, 2015, 1:16:15 PM11/10/15
to or-tools-discuss

My setup is a bit nonstandard, but I've got some of the python solvers working: (pywrapgraph, knapsack, LP)


However, `build/src/gen/ortools/constraint_solver/pywrapcp.py` has an inexplicable and unmet dependency on:


`import google3.util.operations_research.constraint_solver.python.pywrapcp`


Has anyone seen this before or have any ideas where it comes from or would be served from?  That file was generated via Swig, so I suspect either swig or protocol buffers are to blame.  Anybody know if using protobuf-2.5.0 (not 2.6.1) could cause this?  It's non-trivial for me to upgrade protobuf in our environment, but I can spend time on it if it will unblock this.


Again, my environment is using some non-standard locations and I had to modify Makefiles a bit to give update locations to zlib and python, but mostly I just `make python` with some custom locations.  


I'm using the following libs:


    'python-2.7.5',

    'gflags-1.6',

    'protobuf-2.5.0',

    'sparsehash-2.0.2',

    'pcre-8.32',

    'zlib-1.2.5',

    'coin-cbc-2.9.5',

    'google-apputils-0.4.2',

    'swig-3.0.1',


Also, are there any plans to move this to autoconf, etc? 


Thanks,

Ryan

Ryan Leary

unread,
Nov 10, 2015, 6:01:10 PM11/10/15
to or-tools-discuss
Does constraint_solver have any different deps than other solvers?

Laurent Perron

unread,
Nov 11, 2015, 4:25:15 AM11/11/15
to or-tools-discuss
Hi

The error is in src/constraint_solver/python/routing.swig

I have yet found a fix in this swig mess.
It is just that we have more swig files, and the include/import is messed up.

I am looking at it.

Thanks

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Laurent Perron

unread,
Nov 11, 2015, 4:38:35 AM11/11/15
to or-tools-discuss
Hi

I fixed it.

Thanks for the report.

Please upgrade the source files, and tell me if you find other problems.

Thanks again.

Ryan Leary

unread,
Nov 11, 2015, 1:25:42 PM11/11/15
to or-tools-discuss
Laurent thank you so much!  This really made my day, you just saved me many hours and I can add this to the FB repo now.

Alessio Nisini

unread,
Nov 11, 2015, 1:27:01 PM11/11/15
to or-tools-discuss
Hi

I have the same problem on my UbuntuMate15.04:
If I run pywraplp_test.py it works, but if I run pywrapcp_test.py the result is:

alessio@alessio-VirtualBox:~/
or-tools-master/examples/tests$ python2.7 pywrapcp_test.py
Traceback (most recent call last):
  File "pywrapcp_test.py", line 18, in <module>
    from ortools.constraint_solver import pywrapcp
  File "/home/alessio/or-tools-master/src/ortools/constraint_solver/../../gen/ortools/constraint_solver/pywrapcp.py", line 164, in <module>
    import google3.util.operations_research.constraint_solver.python.pywrapcp
ImportError: No module named google3.util.operations_research.constraint_solver.python.pywrapcp

Another example whit errors is golomb8.py

alessio@alessio-VirtualBox:~/or-tools-master/examples/python$ python golomb8.py
Traceback (most recent call last):
  File "golomb8.py", line 26, in <module>
    from google.apputils import app
  File "/usr/local/lib/python2.7/dist-packages/google_apputils-0.4.2-py2.7.egg/google/apputils/app.py", line 37, in <module>
    import gflags as flags
ImportError: No module named gflags

I've install thirty party and python modules after your last post, but the problem persists.
How can I fix it?

thanks

Laurent Perron

unread,
Nov 11, 2015, 1:56:39 PM11/11/15
to or-tools-discuss
No, the fix is currently only available if you build from sources.
I should make binaries available soon, but I am waiting on a big push on the routing library for that.

Thanks

Reply all
Reply to author
Forward
0 new messages