Git Product home page Git Product logo

Comments (7)

mvinni avatar mvinni commented on August 11, 2024 1

maxfield uses python2 (2.7.11 or so). It will not work with python3.

$ python2 --version
Python 2.7.11

$ python2 maxfield.py ...

from maxfield.

jpeterbaker avatar jpeterbaker commented on August 11, 2024

You're right. I thought I corrected the documentation when "makePlan.py" was renamed "maxfield.py". I'll fix it now. Thanks!

from maxfield.

whytecrow avatar whytecrow commented on August 11, 2024

Thanks for a quick reply, anyway, the script fails with complaints about parentheses. I think it's due recent python version (3.5) - obviously the print statement needs the arguments closed in parentheses. After correcting that, the script cannot import geometry module.. This is a little bit beyond my knowledge - the file is in lib as well as the other passed to the import command.

Corrected files:

maxfield.py35.txt
lib.maxfield.py35.txt

from maxfield.

jpeterbaker avatar jpeterbaker commented on August 11, 2024

I very unwisely had two files named "maxfield.py" in the project, but since one was tucked away in lib, I thought it wouldn't matter. I've changed one to lib/makeFields.py. Get this version and make sure you're running maxfield.py and not something that's in the lib directory. Does that solve your problems?

from maxfield.

whytecrow avatar whytecrow commented on August 11, 2024

No. I'm sorry to say. I didn't run the lib/maxfield.py script, either.

$ python maxfield.py -n 4 EXAMPLE.csv output/ output.pkl 
Traceback (most recent call last):
  File "maxfield.py", line 27, in <module>
    from lib import makeFields,PlanPrinter,geometry,agentOrder
  File "/home/mine/maxfield/lib/makeFields.py", line 23, in <module>
    import geometry
ImportError: No module named 'geometry'

So I added "from lib" to all imported scripts, et voila..

$ python maxfield.py -n 4 EXAMPLE.csv output/ output.pkl 
Maxfield Copyright (C) 2015 Jonathan Baker: [email protected]
Traceback (most recent call last):
  File "maxfield.py", line 251, in <module>
    sys.exit(main())
  File "maxfield.py", line 153, in main
    for i in xrange(n):
NameError: name 'xrange' is not defined

from maxfield.

whytecrow avatar whytecrow commented on August 11, 2024

Yeah! That's it. I didn't know that the 2.7 version was installed as well. I'll have to install 2.7 libs.
xrange function was replaced by range in 3.0... Little more hacking and it will work!

from maxfield.

jpeterbaker avatar jpeterbaker commented on August 11, 2024

Thanks! I've barely touched Python 3, but I didn't think that could be the whole problem.

from maxfield.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.