Run itzi with Python version to 2.7

34 views
Skip to first unread message

Jairo Arturo Torres M.

unread,
Jan 17, 2020, 5:20:33 AM1/17/20
to Itzï
Dear all,

I am having troubles to run a Itzï model because my GRASS GIS 7.8.2. installation uses Python 3.6.9. The error message is this:

Starting simulation of lisbon_rain20181021_tr2year_100m_1hour_2018_parameters.ini...


WARNING: Error during execution: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/itzi/itzi.py", line 210, in sim_runner_worker
    sim_runner.run()
  File "/usr/local/lib/python3.6/dist-packages/itzi/itzi.py", line 80, in run
    gis.check_output_files(self.conf.output_map_names.itervalues())
AttributeError: 'dict' object has no attribute 'itervalues'

Simulations complete. Elapsed times:
lisbon_rain20181021_tr2year_100m_1hour_2018_parameters.ini: 0:00:00             
Total: 0:00:00
Average: 0:00:00


As far as I understood  Itzï requires python 2.7.17 or at least I can run successfully my model with Python 2.7.17.
Did somebody face and solve this same issue?

Kind regards,

Arturo

Behzad Jamali

unread,
Jan 17, 2020, 5:57:02 AM1/17/20
to Jairo Arturo Torres M., Itzï
I’m not sure but I think grass is not supported by python 3 yet.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Itzï" group.
To unsubscribe from this group and stop receiving emails from it, send an email to itzi+uns...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/itzi/c6e02795-5a65-4ff0-beac-cdf1b8b45629%40googlegroups.com.

Laurent C.

unread,
Jan 20, 2020, 11:09:08 AM1/20/20
to Behzad Jamali, Jairo Arturo Torres M., Itzï
Hi Jairo,

Itzï was written at a time when GRASS was not supporting Python 3. Therefore, Itzï supports only Python 2.7.
The error you see is a typical Python 2 to 3 porting issue. Changing itervalues() to values() should solve this particular problem, but you will likely run into other similar issues.
Porting Itzï to Python 3 should not be very complex. Unfortunately I do not have to time to work on it now.
Help is welcome to port Itzï to Python 3. I would be more than happy to review a Pull Request on that matter.
In the mean time, the solution is to stick to Python 2.7.

Best regards,
Laurent

Reply all
Reply to author
Forward
0 new messages