-
Notifications
You must be signed in to change notification settings - Fork 8
Getting Started and Troubleshooting
Anthony Fok edited this page Mar 28, 2024
·
3 revisions
[incomplete draft, work-in-progress]
- OQ 3.11 needs Python 3.8 which is old, whereas newer macOS comes with Python 3.10 or higher.
- Multiple versions of Python (esp. on macOS), often from multiple sources (from macOS, from python.org, from Homebrew (pre-compiled), from Homebrew's pyenv) with e.g. symlinks to
python
/python3
/pip
of mixed version is often the culprit. -
sqlite3.OperationalError: table sqlite_master may not be modified
(See gem/oq-engine#9270) - Lingering OQ process may need to be manually killed?
brew install parallel
- Git
- Git-LFS (on macOS:
brew install git git-lfs
) - Python 3.6, 3.7 or 3.8 (e.g. 3.8.18) (OpenQuake Engine 3.11.x is incompatible with Python 3.9 and above.)
- On Python.org, the latest and final pre-compiled version (for macOS and Windows) is 3.8.10, see Python Release Python 3.8.10 | Python.org.
- Example: macOS Monterey comes with Python 3.8.9, but probably can’t use it due to possible “sqlite3.OperationalError: table sqlite_master may not be modified” error; see below.
- Double-check that
pip3
points to the correct version (e.g. Python 3.8 and not Python 3.10)
- OpenQuake Engine 3.11.5
-
git clone https://github.com/gem/oq-engine.git --branch=engine-3.11
;python3 install.py devel
.- Do not use
python3 install.py user
which will install the latest stable version (e.g. OpenQuake 3.18) which is too new for.
- Do not use
-
git clone https://github.com/OpenDRR/CanadaSHM6.git
git clone https://github.com/OpenDRR/earthquake-scenarios.git
git clone https://github.com/OpenDRR/openquake-inputs.git
repo | commit hash | date |
---|---|---|
CanadaSHM6 | 2b00461734b10fe68ed28c37d2d7ef9783047e46 | 2021-10-22 |
earthquake-scenarios | ||
openquake-inputs | ca98dceb08310b8c5dbe07c13e6fc80fb87c0dba | 2023-02-09 |
After activating OpenQuake environment (source ~/openquake/bin/activate
):
- pip3 install tqdm xlrd==1.2.0
- cd path-to/earthquake-scenarios
- bash -e -x scripts/run_OQStandard.sh ACM7p3_LeechRiverFullFault -h -d -r -b
From https://github.com/OpenDRR/opendrr/discussions/141:
Unfortunately that repo is not publicly available yet. NRCan is working on getting all final approvals and documentation in place to be able to release this to the public, as soon as possible. Thanks for your patience.
IndexError: list index out of range
Traceback (most recent call last):
File “/Users/MacBookUser/src/oq-engine/openquake/baselib/datastore.py”, line 257, in __init__
self.calc_id = calc_ids[calc_id]
IndexError: list index out of range
scripts/run_OQStandard.sh in the master
branch is buggy because one of the oq engine --run
commands was inadvertently commented out. Temporary workaround:
git remote add anthonyfok https://github.com/anthonyfok/earthquake-scenarios.git
git fetch anthonyfok
git switch use-GNU-parallel-for-consequences-calc
Same as above.
If you are using pyenv on macOS 11 Big Sur, macOS 12 Monterey or newer, it compiles Python from source using system sqlite3 library, but...
If you need to have sqlite first in your PATH, run:
echo ‘export PATH=“/usr/local/opt/sqlite/bin:$PATH”’ >> ~/.zshrc
For compilers to find sqlite you may need to set:
export LDFLAGS=“-L/usr/local/opt/sqlite/lib”
export CPPFLAGS=“-I/usr/local/opt/sqlite/include”
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH=“/usr/local/opt/sqlite/lib/pkgconfig”