Closed mricon closed 5 years ago
Thanks for the update for ortools 7. However, I get error when running the the latest release. Not sure if there is a problem with my configuration.
$ pip install -r requirements.txt
Requirement already satisfied: matplotlib in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (3.1.1)
Requirement already satisfied: networkx in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (2.3)
Requirement already satisfied: numpy in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (1.16.4)
Requirement already satisfied: google-api-python-client in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (1.7.9)
Requirement already satisfied: oauth2client in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (4.1.3)
Requirement already satisfied: httplib2 in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (0.13.0)
Requirement already satisfied: ortools<8.0,>=7.0 in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 7)) (7.2.6977)
Requirement already satisfied: googlemaps in ./tempvenv/lib/python3.7/site-packages (from -r requirements.txt (line 8)) (3.0.2)
Requirement already satisfied: cycler>=0.10 in ./tempvenv/lib/python3.7/site-packages (from matplotlib->-r requirements.txt (line 1)) (0.10.0)
Requirement already satisfied: python-dateutil>=2.1 in ./tempvenv/lib/python3.7/site-packages (from matplotlib->-r requirements.txt (line 1)) (2.8.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./tempvenv/lib/python3.7/site-packages (from matplotlib->-r requirements.txt (line 1)) (2.4.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./tempvenv/lib/python3.7/site-packages (from matplotlib->-r requirements.txt (line 1)) (1.1.0)
Requirement already satisfied: decorator>=4.3.0 in ./tempvenv/lib/python3.7/site-packages (from networkx->-r requirements.txt (line 2)) (4.4.0)
Requirement already satisfied: six<2dev,>=1.6.1 in ./tempvenv/lib/python3.7/site-packages (from google-api-python-client->-r requirements.txt (line 4)) (1.12.0)
Requirement already satisfied: google-auth>=1.4.1 in ./tempvenv/lib/python3.7/site-packages (from google-api-python-client->-r requirements.txt (line 4)) (1.6.3)
Requirement already satisfied: uritemplate<4dev,>=3.0.0 in ./tempvenv/lib/python3.7/site-packages (from google-api-python-client->-r requirements.txt (line 4)) (3.0.0)
Requirement already satisfied: google-auth-httplib2>=0.0.3 in ./tempvenv/lib/python3.7/site-packages (from google-api-python-client->-r requirements.txt (line 4)) (0.0.3)
Requirement already satisfied: pyasn1-modules>=0.0.5 in ./tempvenv/lib/python3.7/site-packages (from oauth2client->-r requirements.txt (line 5)) (0.2.5)
Requirement already satisfied: rsa>=3.1.4 in ./tempvenv/lib/python3.7/site-packages (from oauth2client->-r requirements.txt (line 5)) (4.0)
Requirement already satisfied: pyasn1>=0.1.7 in ./tempvenv/lib/python3.7/site-packages (from oauth2client->-r requirements.txt (line 5)) (0.4.5)
Requirement already satisfied: protobuf>=3.8.0 in ./tempvenv/lib/python3.7/site-packages (from ortools<8.0,>=7.0->-r requirements.txt (line 7)) (3.9.0)
Requirement already satisfied: requests<3.0,>=2.11.1 in ./tempvenv/lib/python3.7/site-packages (from googlemaps->-r requirements.txt (line 8)) (2.22.0)
Requirement already satisfied: setuptools in ./tempvenv/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib->-r requirements.txt (line 1)) (40.8.0)
Requirement already satisfied: cachetools>=2.0.0 in ./tempvenv/lib/python3.7/site-packages (from google-auth>=1.4.1->google-api-python-client->-r requirements.txt (line 4)) (3.1.1)
Requirement already satisfied: idna<2.9,>=2.5 in ./tempvenv/lib/python3.7/site-packages (from requests<3.0,>=2.11.1->googlemaps->-r requirements.txt (line 8)) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./tempvenv/lib/python3.7/site-packages (from requests<3.0,>=2.11.1->googlemaps->-r requirements.txt (line 8)) (1.25.3)
Requirement already satisfied: certifi>=2017.4.17 in ./tempvenv/lib/python3.7/site-packages (from requests<3.0,>=2.11.1->googlemaps->-r requirements.txt (line 8)) (2019.6.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./tempvenv/lib/python3.7/site-packages (from requests<3.0,>=2.11.1->googlemaps->-r requirements.txt (line 8)) (3.0.4)
$ ./fieldplan.py -n -s https://docs.google.com/spreadsheets/d/1TbwOCNpsvA7CjOTPv_98Iirjt_siOoAgoTKa0PTglgU/edit
Grabbing the spreadsheet
Adding portal: Hotel de Ville de Montreal
Adding portal: Le Logotype
Adding portal: Statue Jean Drapeau
Adding portal: Le Château Ramezay
Adding portal: La Grande Recrue
Adding portal: The Nelson Column
Adding portal: Itinerant Pods
Adding portal: Hotel Nelson
Adding portal: Edifice Viger
Adding portal: Edifice de la Sauvegarde
Adding portal: Centre d'art Lambert
Adding portal: Old Building Hôtel Richelieu
Adding portal: Cour d'Appel du Québec
Adding portal: Hommage à Marguerite Bourgeoys
Adding portal: Jacques-Cartier Plaque
Considering 15 portals and 0 waypoints
Generating the distance matrix
Finding an efficient plan that maximizes AP
Process Process-1:
Started 2 worker processes
Ctrl-C to exit and use the latest best plan
Process Process-2:
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "./fieldplan.py", line 34, in queue_job
if ready_queue.qsize() > 10:
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/queues.py", line 117, in qsize
return self._maxsize - self._sem._semlock._get_value()
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
self._tarNotImplementedError
get(*self._args, **self._kwargs)
File "./fieldplan.py", line 34, in queue_job
if ready_queue.qsize() > 10:
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/queues.py", line 117, in qsize
return self._maxsize - self._sem._semlock._get_value()
NotImplementedError
^C
Exiting loop
Could not find a solution for this list of portals.
Heh, woah, my first cross-platform compatibility issue with Python! :) Let me see if I can figure out how to make it work on OS X. It's not related to ortools, so I'll make a new issue for this.
Let me know if the latest commit fixes this for you -- I don't have an OS X system to test this on.
I can confirm it's working now. Thanks!
Google's ortools-7 is not backwards compatible, so fix the code to support the newer release.