Example not working
The example listed in the ReadMe is not working. I see the following errors when I try to run it: AttributeError: 'module' object has no attribute 'Grid' AttributeError: 'module' object has no attribute 'Point'
Does it need to be updated?
Looks like that you use another library (or it was installed later) that provides module with same name. For example I reproduced this behaviour performs following command pip install hexgrid.
I recommend to performs following command: pip install --force-reinstall -U hexgrid-py
I did a pip install hexgrid yesterday. I now realize it should have been hexgrid-py. Update the ReadMe maybe?
I now ran the command suggested by you and then tried to execute the example code. I get this error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-4f6ec1210952> in <module>()
----> 1 import hexgrid
2 import morton
3
4 center = hexgrid.Point(0, 0)
5 size = hexgrid.Point(20, 10)
/home/bhaskardhariyal/.virtualenvs/pycuda/local/lib/python2.7/site-packages/hexgrid.py in <module>()
2 import math
3 import sys
----> 4 from morton import Morton
5
6 try:
ImportError: cannot import name Morton
Ideas?
Requirements had not been installed. As you can see here the morton-py package is required for properly working. I don't have idea why pip did not install needed requirements, but you can try to install it manually: pip install -U morton-py
morton was already installed during the installation of hexgrid, as expected. I did not get an error when i did "import morton". I tried to reinstall morton using the command that you shared. I got the confirmation that it is already installed.(Below message is from the terminal)
Requirement already up-to-date: morton-py in ./.virtualenvs/pycuda/lib/python2.7/site-packages
So, it means that you have the same problem as above with hexgrid - looks like that you have installed package morton that provides the same module. Just reinstall morton-py.
Thank you. That worked. Could you provide some documentation on how to use the library?