Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makePlan.py script #36

Open
whytecrow opened this issue Jun 3, 2016 · 7 comments
Open

makePlan.py script #36

whytecrow opened this issue Jun 3, 2016 · 7 comments

Comments

@whytecrow
Copy link

I cannot find the script, am I the only one? Running the example gives me the "No such file or directory" error. I'm lost..

@jpeterbaker
Copy link
Owner

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

@whytecrow
Copy link
Author

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

@jpeterbaker
Copy link
Owner

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?

@whytecrow
Copy link
Author

whytecrow commented Jun 7, 2016

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

@mvinni
Copy link

mvinni commented Jun 7, 2016

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

$ python2 --version
Python 2.7.11

$ python2 maxfield.py ...

@whytecrow
Copy link
Author

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!

@jpeterbaker
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants