ortools install is incomplete

1,517 views
Skip to first unread message

Karl Schelhammer

unread,
May 20, 2019, 9:47:01 AM5/20/19
to or-tools-discuss
Hi Folks,

I have posted about this a few other places:  


Basically, I'm getting an error when I try to load any module contained by the library.  The base module is there but doesn't seem to contain all the classes/methods.  Someone suggested checking to see if conda was 64 bit which it is.  Otherwise I'm kind of at a loss.  Any suggestion as to what to try next would be a huge help.

from __future__ import print_function
from ortools.linear_solver import pywraplp

Traceback (most recent call last):
  File "simple_ortools_example.py", line 2, in <module>
    from ortools.linear_solver import pywraplp
ImportError: No module named ortools.linear_solver

Laurent Perron

unread,
May 20, 2019, 9:55:51 AM5/20/19
to or-tools-discuss
Can you try installing an official python version (not anaconda) and try it with this ?
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/1b51db3a-ece0-4a48-9574-ea5126a08819%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karl Schelhammer

unread,
May 20, 2019, 10:19:32 AM5/20/19
to or-tools-discuss
I downgraded the version which solves the problem:

pip install ortools==6.7.4973


On Monday, May 20, 2019 at 9:55:51 AM UTC-4, Laurent Perron wrote:
Can you try installing an official python version (not anaconda) and try it with this ?
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



Le lun. 20 mai 2019 à 15:47, Karl Schelhammer <karl.sc...@gmail.com> a écrit :
Hi Folks,

I have posted about this a few other places:  


Basically, I'm getting an error when I try to load any module contained by the library.  The base module is there but doesn't seem to contain all the classes/methods.  Someone suggested checking to see if conda was 64 bit which it is.  Otherwise I'm kind of at a loss.  Any suggestion as to what to try next would be a huge help.

from __future__ import print_function
from ortools.linear_solver import pywraplp

Traceback (most recent call last):
  File "simple_ortools_example.py", line 2, in <module>
    from ortools.linear_solver import pywraplp
ImportError: No module named ortools.linear_solver

--
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...@googlegroups.com.

Laurent Perron

unread,
May 20, 2019, 10:27:06 AM5/20/19
to or-tools-discuss
Yes, but you are missing an update CP-SAT solver, and a much improved routing library.

I just tried installing 7.1 on a clean mac laptop with python 3.7.3 installed, and it worked flawlessly.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/e197303f-d5d8-467c-aa53-b78f49127a08%40googlegroups.com.

Laurent Perron

unread,
May 20, 2019, 11:05:21 AM5/20/19
to or-tools-discuss
And with Anaconda, it works also perfectly

./bin/python3.7 -m pip install ortools

Collecting ortools

  Using cached https://files.pythonhosted.org/packages/ce/3b/58f8ada0853b21c38d1fab15e024b3d5882f919bcf5a6edd55732c755cd4/ortools-7.1.6720-cp37-cp37m-macosx_10_9_x86_64.whl

Collecting protobuf>=3.7.1 (from ortools)

  Using cached https://files.pythonhosted.org/packages/d7/08/a316e74d41a1f3d606dfc3b71cc068354e8b9a0232f46bc098aa50b37116/protobuf-3.7.1-cp37-cp37m-macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Requirement already satisfied: six>=1.10 in ./lib/python3.7/site-packages (from ortools) (1.12.0)

Requirement already satisfied: setuptools in ./lib/python3.7/site-packages (from protobuf>=3.7.1->ortools) (40.8.0)

Installing collected packages: protobuf, ortools

Successfully installed ortools-7.1.6720 protobuf-3.7.1


anaconda3$ ./bin/python3.7 ~/Work/or-tools/examples/python/integer_programming.py 

---- Integer programming example with CBC (natural language API) -----

Number of variables = 2

Number of constraints = 1

Problem solved in 7.000000 milliseconds

Optimal objective value = 6.000000

x1 = 6.000000

x2 = 0.000000

Advanced usage:

Problem solved in 0 branch-and-bound nodes

---- Integer programming example with CBC (C++ style API) -----

Number of variables = 2

Number of constraints = 1

Problem solved in 3.000000 milliseconds

Optimal objective value = 6.000000

x1 = 6.000000

x2 = 0.000000

Advanced usage:

Problem solved in 0 branch-and-bound nodes

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


Karl Schelhammer

unread,
May 20, 2019, 11:26:38 AM5/20/19
to or-tools-discuss
Yep, confirmed.  Works for me with python 3.7.3.  I was using 3.6 which appears to be related to my issue.
Reply all
Reply to author
Forward
0 new messages