tvwenger / maxfield

An Ingress Linking and Fielding Strategy Generator
http://www.ingress-maxfield.com/
GNU General Public License v3.0
106 stars 56 forks source link

ortools requiring protobuf>=4.21.5. #43

Open christyzachsunny opened 1 year ago

christyzachsunny commented 1 year ago

while executing: maxfield-plan portals16.txt --num_agents 1 --num_field_iteration 100000 --num_cpus 0 --max_route_runtime 3600 --verbose --output_csv ortools requiring protobuf>=4.21.5 while using:

  1. github code spaces
  2. WSL2 ubuntu

pkg_resources.ContextualVersionConflict: (protobuf 3.19.4 (/usr/local/python/3.10.4/lib/python3.10/site-packages/protobuf-3.19.4-py3.10.egg), Requirement.parse('protobuf>=4.21.5'), {'ortools'}) Teminal log.txt

Any workaround would be helpful

flutesa commented 1 year ago

I encountered the same issue while using

  1. MacOS Ventura 13.1
  2. Python 3.9

It was able to fix it after doing these steps:

  1. Replace in setup.py on line 10 version protobuf==3.19.4 to protobuf==4.21.12

  2. Then while running the script by command maxfield-plan /Users/aguseva/PycharmProjects/ingress/maxfield/my_portals.txt --num_agents 2 --num_cpus 0 --output_csv I was having this problem: AttributeError: module '__main__' has no attribute '__spec__' To fix it I changed my command to python3 -m maxfield-plan /Users/aguseva/PycharmProjects/ingress/maxfield/my_portals.txt --num_agents 2 --num_cpus 2 --verbose --output_csv And in setup.py on line 12 scripts=['bin/maxfield-plan'], to scripts=['bin/maxfield-plan.py'], And in your file system add '.py' to this file name accordingly. Finally, it was fixed and worked out for me!

🎉 Wish you success and hope it'll be working fine for you too! Have joyful game)