1

I'm having issues running ortools on Linux. I downloaded it from google's site (https://developers.google.com/optimization/) and installed it using "make install," but when I go to use it in python I get the following:

Traceback (most recent call last):
  File "regular.py", line 42, in <module>
    from ortools.constraint_solver import pywrapcp
  File "/home/m3/summer/ortools_examples/examples/python/ortools.py", line 2, in <module>
ImportError: No module named linear_solver

It looks like despite installing ortools, its still not in my python path correctly, so when I call it in the file, it doesn't find anything and returns an error, right? Any advice on how to solve this?

Max
  • 11
  • 3
  • Generally, you install things doing: "./configure", then "make", then "sudo make install". Are these the steps you followed? – Jugurtha Hadjar Aug 16 '17 at 20:31
  • What's ./configure? typed it in on its own and it didn't do anything. I ran "sudo make install" instead "make install" and got a traceback error: NameError: name 'PROTOCOL_TLS' is not defined. Makefile:52: recipe for target 'install' failed – Max Aug 16 '17 at 20:45
  • Sorry, I said generally. I'm looking at the install steps and they don't seem to have a configure file. They do, however, list dependencies you have to install *before* trying to install OR. Did [you install those](https://developers.google.com/optimization/introduction/installing.html#unix)? – Jugurtha Hadjar Aug 16 '17 at 21:07
  • Why didn't you install this package from pypi (with pip) as it exists in pypi ? – Gribouillis Aug 16 '17 at 22:14
  • I was following the instructions on the google page I linked. It seemed to be an error with anaconda? if I run '/usr/bin/python regular.py' it will work fine, but if I run just 'python regular.py' it will return 'bash: /home/m3/anaconda2/bin/python: No such file or directory' because I deleted anaconda (it was unnecessary, oops). How do I change things so that python automatically goes to my /usr/bin/python in stead of /home/m3/anaconda2/bin/python? – Max Aug 17 '17 at 18:09
  • If you have this interpreter because you activated a virtualenv, then use the accepted answer [here](https://stackoverflow.com/questions/990754/how-to-leave-exit-deactivate-a-python-virtualenv) to deactivate the virtualenv. Also start a new terminal and type `which python`. – Gribouillis Aug 18 '17 at 19:50
  • I fixed it by reinstalling with pypip. Thank you! – Max Aug 25 '17 at 03:31

0 Answers0