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

Not able to install Itzi, how to install Itzi in 2023? #107

Closed
JSUNFGH opened this issue Sep 14, 2023 · 8 comments
Closed

Not able to install Itzi, how to install Itzi in 2023? #107

JSUNFGH opened this issue Sep 14, 2023 · 8 comments

Comments

@JSUNFGH
Copy link

JSUNFGH commented Sep 14, 2023

Hello, I've been using Itzi for some years now, mostly without problems. But now, after several days of trying I'm stuck. I wanted to install Itzi to a new system with better CPU and more RAM but, but I'm not able to do this, getting constant errors. I've tried the following on four different systems, using Linux Mint 21.2, Kubuntu 22.04, Ubuntu 22.04 with Grass Gis 8.2.1 and 7.8.7. The errors are basically the same on all systems. Here is what I tried and the errors I got:

  1. Install Ubuntu 22.04 LTS and Grass GIS 7.8.7-1 (following hints from @geoendemics and @lrntct on issue error when trying to run itzi. #106)
  2. Install python3-pip python3-setuptools python3-wheel
  3. Package itzi-20.5 downloaded from https://pypi.org/project/itzi/20.5/#files
  4. Trying to install local package via python3 setup.py install --user (as suggested on https://itzi.readthedocs.io/en/latest/installation.html#installation-for-a-single-user) resulting in error: Itzi_Install_Log_1.txt
  5. Second try to install online version of 20.5 via sudo pip install itzi (as suggested on https://itzi.readthedocs.io/en/latest/installation.html#installation-for-all-users) resulting in error: Itzi_Install_Log_2.txt
  6. Third try: downloading master package from Github (https://github.com/ItziModel/itzi), trying to build/install locally via sudo python3 setup.py build und sudo python3 setup.py install and building already resulted in error: Itzi_Install_Log_3.txt

In years before sudo pip install itzi always worked for me. What am I doing wrong? @lrntct: How can I install Itzi in 2023? Please help, I need Itzi for an ongoing project. Thank you.

@geoendemics
Copy link

geoendemics commented Sep 14, 2023

hi @JSUNFGH
following the hint from @lrntct I did the following: remove python 2.7 carefully as explained here https://gist.github.com/akshilshah/46b0637888f9161eb31b4a7c21d207c1 and reinstalled itzi using pip install itzi --user. This made the trick for me. So far I got it running.

GRASS 7.8.6 (xxx):~ > itzi run -h
usage: itzi run [-h] [-o] [-p] [-v | -q] config_file [config_file ...]

positional arguments:
config_file an Itzï configuration file (if several given, run in batch
mode)

optional arguments:
-h, --help show this help message and exit
-o overwrite files if exist
-p activate profiler
-v increase verbosity
-q decrease verbosity
GRASS 7.8.6 (xxxx):~ > itzi version
20.5
GRASS 7.8.6 (xxxx):~ > python
Python 3.6.9 (default, Mar 10 2023, 16:46:00)

I am going to give a try to run a simulation tomorrow to see if everything works ok. By the way I am running linux ubuntu 18 lts.

@JSUNFGH
Copy link
Author

JSUNFGH commented Sep 15, 2023

Thank you @geoendemics for your reply. I don't think we have the same errors. Python 2.7 is not an issue for me. I installed my system fresh and are running Python 3.10.12. Still, I think it's strange that you are able to install Itzi via pip install itzi --user and I get quite some errors using the same command. I get these errors (see https://github.com/ItziModel/itzi/files/12607649/Itzi_Install_Log_2.txt for full details):


building 'itzi.flow' extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/itzi
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.10 -c itzi/flow.c -o build/temp.linux-x86_64-3.10/itzi/flow.o -O3 -w -fopenmp
itzi/flow.c: In function ‘__pyx_tp_dealloc_array’:
itzi/flow.c:23021:5: error: lvalue required as increment operand
23021 | ++Py_REFCNT(o);
| ^~
itzi/flow.c:23023:5: error: lvalue required as decrement operand
23023 | --Py_REFCNT(o);
| ^~
itzi/flow.c: In function ‘__pyx_tp_dealloc_memoryview’:
itzi/flow.c:23332:5: error: lvalue required as increment operand
23332 | ++Py_REFCNT(o);
| ^~
itzi/flow.c:23334:5: error: lvalue required as decrement operand
23334 | --Py_REFCNT(o);
| ^~
itzi/flow.c: In function ‘__pyx_tp_dealloc__memoryviewslice’:
itzi/flow.c:23582:5: error: lvalue required as increment operand
23582 | ++Py_REFCNT(o);
| ^~
itzi/flow.c:23584:5: error: lvalue required as decrement operand
23584 | --Py_REFCNT(o);
| ^~
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for itzi
Running setup.py clean for itzi
Failed to build itzi


I don't know for sure what it means. It seems to be some incorrect syntax in itzi/flow.c which the installer can't get past. You @geoendemics said in your post you were able to install it under Ubuntu 22.04.3 LTS, so I tried the same distro, but to no success. @lrntct said it's not tested under Grass 8.x, so I sticked to Grass 7.8.7 as stated in the manual, but to no success. I don't know what else to try. Maybe @lrntct can shed some light on this issue?

@geoendemics
Copy link

errata: I got it working on ubuntu 18 lts @JSUNFGH .
By the way I am pretty novice using itzi can @lrntct help me to understand what means... ` error during execution:itzi.itzi.error. DtError: dt must be positive (0,0). I am ruining a very large model

g.region -p
projection: 0 (x,y)
zone: 0
north: 6175599.5932
south: 6125469.5932
west: 281507.3042
east: 385817.3042
nsres: 30
ewres: 30
rows: 1671
cols: 3477
cells: 5810067
(Sat Sep 16 23:59:02 2023) Command finished (0 sec)
Is a very hilly area.. below the parameter file.. am I missing something.?. It runs though, but it seems to have numerical instabilities
[time]
duration = 3:00:00
record_step = 00:05:00

[input]
dem = Chile_19s_sirgas2021@PERMANENT
friction = n@PERMANENT
rain = rain@PERMANENT
bctype = bctype@PERMANENT
bcval = bcvalue@PERMANENT

[output]
prefix = ch_test_itzi_tutorial
values = h, wse, v, vdir, boundaries

[statistics]
stats_file = ch_test_itzi_tutorial.csv

precipitation is 150mm in 3 hours.
thanks in advance

@lrntct
Copy link
Contributor

lrntct commented Sep 16, 2023

@geoendemics I guess that negative dt might occur in case of numerical instabilities, where dt tends to zero. You should try to resolve those instabilities.

@rengifoo
Copy link

@geoendemics I guess that negative dt might occur in case of numerical instabilities, where dt tends to zero. You should try to resolve those instabilities.

I would like to do so. But as I said I am new to itzi. Although eager to learn about it. Do you have some more descriptive documentation so I can start looking for answers? such as numerical instabilities, max size allowed for calculation areas and so on I would appreciate any hints. Best regards

@lrntct
Copy link
Contributor

lrntct commented Sep 18, 2023

@geoendemics you might find some answers in the FAQ

@JSUNFGH
Copy link
Author

JSUNFGH commented Sep 18, 2023

errata: I got it working on ubuntu 18 lts @JSUNFGH .

@geoendemics Thanks for the hint; I will try Ubuntu 18.04 LTS with GRASS 7.8.6 an Python 3.6.9 as well.

@JSUNFGH
Copy link
Author

JSUNFGH commented Sep 28, 2023

itzi version 20.5 GRASS 7.8.6 (xxxx):~ > python Python 3.6.9 (default, Mar 10 2023, 16:46:00)
By the way I am running linux ubuntu 18 lts.

@geoendemics I finally had time to also try Ubuntu 18.04 LTS and that did the trick for me too. I now have Itzi 20.5 (master version) running without problems under Grass GIS 7.8.6.1 with Python 3.6.9. Seems to me like incompatibilities with newer Linux/Grass/Python versions, as mentioned above. Other versions (dev, forks) are still not working. That will be my next step: trying to get dev version or the itzi2D fork (https://github.com/febex2008/itzi2D) to work as they have important bug corrections implemented that haven't made it to the master version yet.

For anyone else having troubles installing Itzi nowadays, this is what I did. Maybe it can help you.

  1. Install Ubuntu 18.04 LTS
  2. Test available GRASS versions in repository via apt-cache madison grass
  3. Add "unstable" repository via sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable and sudo apt update
  4. Test available GRASS versions in repository via apt-cache madison grass
  5. Install GRASS 7.8.6 via sudo apt install grass=7.8.6-1~bionic1
  6. Set GRASS on hold to prevent updates via sudo apt-mark hold grass
  7. Install pip via sudo apt install python3-pip
  8. Install Itzi for user only via pip3 install itzi --user
  9. Check Itzi version via itzi version
  10. If you get an "error, not found...", check Path via echo $PATH and add installation directory /home/.../.local/bin to Path via export PATH=/home/.../.local/bin:$PATH (see manual: https://itzi.readthedocs.io/en/latest/installation.html#installation-for-a-single-user)
  11. Check Path via echo $PATH
  12. Check Itzi version via itzi version
  13. Use Itzi in GRASS :)

@JSUNFGH JSUNFGH closed this as completed Sep 28, 2023
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

4 participants