-
Notifications
You must be signed in to change notification settings - Fork 54
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
Error in extracting agent from GeoSpace.agents in tutorial using Spyder #193
Comments
Thanks for sharing the code and screenshot. The error appears to be from type hints. Can I ask which version of Python you were using? Mesa & Mesa-Geo require Python 3.9 and above. I couldn't reproduce the error with Python 3.10. Perhaps try to recreate a clean virtual environment with Python 3.9 or above, install Mesa-Geo and try again? |
This is indeed an error caused by new syntax introduced in Python 3.9. Upgrading should resolve the problem. @wang-boyu the more interesting problem is how users manage to install Mesa-geo with incompatible Python versions. Have we set our Python requirements correctly in this repo? https://packaging.python.org/en/latest/guides/dropping-older-python-versions/#specify-the-version-ranges-for-supported-python-distributions |
Python requirement is specified in the Line 29 in b717971
Edit: in python 3.8 I could only install mesa-geo 0.8.0. When attempting to install 0.9.0, there is an error message indicating python >= 3.9 is required, which is as expected. |
Yes, this is indeed the case and it's configured correctly: https://github.com/EwoutH/mesa/actions/runs/8379466683 @whitbern which version of mesa-geo are you using and which Python version? How did you install mesa-geo? |
Hello--I have Python 3.11.5 I have the latest version of mesa-geo: 0.7.0. I installed mesa-geo using these commands for Windows in the Anaconda Prompt: conda install fiona pyproj rtree shapely |
Right, I read the error wrongly. Seems like an issue in the GeoSpace or the mesa space itself.
|
this is an attachment of the script mesa_geo_tutorial.txt
this is a screenshot of the error error_mesa_geo_tutorial
Good evening, currently, I am doing the tutorial for Mesa-geo using Spyder. When I try to extract the agents using this line:
agent = m.space.agents[0]
I get a TypeError stating that: 'type' object is not subscriptable. Before that, I get a "Coordinate = tuple[int, int]." However, when I look at the mesa.space module, they mention lists?
I would expect for this just to give me the first agent from the listed url.
Thankfully this works just fine in Jupyter Notebook. Can you all help me figure out why this is not working in Spyder?
Thanks!
The text was updated successfully, but these errors were encountered: