mricon / ingress-fieldplan

Generate an easy workplan for Ingress fielding excursions
GNU General Public License v3.0
31 stars 8 forks source link

Unable to fulfill requirements ortools < 7.0 #8

Closed danwie closed 5 years ago

danwie commented 5 years ago

I'm trying to install ingress fieldplan on a macbook pro (2009) with osx el capitan 10.11.6.

It seems latest ortools is 7.1. Fieldplan requirements is "< 7.0"

I get the following error when trying to install:

$ pip3 install -r requirements.txt
Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (3.1.0)
Requirement already satisfied: networkx in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (2.3)
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (1.16.4)
Requirement already satisfied: google-api-python-client in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (1.7.9)
Requirement already satisfied: oauth2client in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (4.1.3)
Requirement already satisfied: httplib2 in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (0.13.0)
**Collecting ortools<7.0 (from -r requirements.txt (line 7))
ERROR: Could not find a version that satisfies the requirement ortools<7.0 (from -r requirements.txt (line 7)) (from versions: 7.0.6546, 7.1.6720, 7.2.6977)
ERROR: No matching distribution found for ortools<7.0 (from -r requirements.txt (line 7))**`

Not sure how to proceed. I've tried editing requirements.txt and remove the version check, but it seems that does not help. When running fieldplan.py I get error.

$ ./fieldplan.py -m bicycling -s https://docs.google.com/spreadsheets/d/1FPMcKGvJATRDTVnJLHtXaOSZo4WST9GssxxxxxxLs/edit?usp=sharing
Grabbing the spreadsheet
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Adding portal: ...
Considering 11 portals
Generating the distance matrix
Finding the shortest plan
Started 2 worker processes
Ctrl-C to exit and use the latest best plan
Process Process-1:
Process Process-2:
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 57, in queue_job
workplan = maxfield.makeWorkPlan(linkplan, b, ab, args.roundtrip, args.beginfirst)
File "/Users/daniel/ingress-fieldplan-master/lib/maxfield.py", line 221, in makeWorkPlan
routing = pywrapcp.RoutingModel(len(all_p), 1, [endp], [startp])
File "/Users/daniel/Library/Python/3.7/lib/python/site-  packages/ortools/constraint_solver/pywrapcp.py", line 3197, in __init__
this = _pywrapcp.new_RoutingModel(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RoutingModel'.
Possible C/C++ prototypes are:
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &)
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &,operations_research::RoutingModelParameters const &)

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 57, in queue_job
workplan = maxfield.makeWorkPlan(linkplan, b, ab, args.roundtrip, args.beginfirst)
File "/Users/daniel/ingress-fieldplan-master/lib/maxfield.py", line 221, in makeWorkPlan
routing = pywrapcp.RoutingModel(len(all_p), 1, [endp], [startp])
File "/Users/daniel/Library/Python/3.7/lib/python/site-packages/ortools/constraint_solver/pywrapcp.py", line 3197, in __init__
this = _pywrapcp.new_RoutingModel(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RoutingModel'.
Possible C/C++ prototypes are:
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &)
operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &,operations_research::RoutingModelParameters const &)`

Could this be related to that I'm using ortools 7.1?

mricon commented 5 years ago

Bah, this is annoying. Yes, the changes in Ortools 7+ are incompatible and I haven't had a chance to port the code to the new codebase yet. It's annoying that they deleted the 6.x distribution.

I'll see if I can prioritize the fix, but for the moment there's not much you can do to get it working, sorry.

danwie commented 5 years ago

Thanks for the reply. Would it be possible to use an old version of ortools? Or are you saying old versions are not available?

mricon commented 5 years ago

Hm... I was actually just able to install it just fine. Which OS are you using?

danwie commented 5 years ago

I'm using osx el capitan 10.11.6. I'm on a vacation and this is a old macbook (2009) that I had to use. On my usual iMac everything is working.

mricon commented 5 years ago

Ah, I can't test things out with OS X, but I would expect it to be sufficiently similar. Can you run:

python3 -m venv tempvenv
source tempvenv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

If you are still getting that "unable to satisfy" error, then it's possible that ortools-6.x is not available for the combination of OS and Python version that you have on that system.

danwie commented 5 years ago

Thank you for your reply. I still get the same error unfortionately.

$ python3 -m venv tempvenv
(tempvenv) 

$ source tempvenv/bin/activate
(tempvenv) 

$ pip install --upgrade pip
Requirement already up-to-date: pip in ./tempvenv/lib/python3.7/site-packages (19.1.1)

$ 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)
Collecting ortools<7.0 (from -r requirements.txt (line 7))
ERROR: Could not find a version that satisfies the requirement ortools<7.0 (from -r requirements.txt (line 7)) (from versions: 7.0.6546, 7.1.6720, 7.2.6977)
ERROR: No matching distribution found for ortools<7.0 (from -r requirements.txt (line 7))

I guess I'll have to find someone that can run my google spreadsheet through the script...

Anyway - thanks for helping - and thank you for this script, it's the best (when it's working) :-D

mricon commented 5 years ago

I can run it for you if you pass me the spreadsheet URL and allow worldwide edits to it. :)

danwie commented 5 years ago

Thanks a lot!!

https://docs.google.com/spreadsheets/d/1uw0z11qXJmwy6n1bKp29k8dk8d1-gsQR8Acxa0v0maA/edit?usp=sharing