From c54d095f5f30feff03b3c1fc6cfe5303dd5a4f6b Mon Sep 17 00:00:00 2001 From: Brett Edwards Date: Thu, 7 Sep 2023 08:18:02 -0700 Subject: [PATCH 1/4] Add troubleshooting to README --- api/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api/README.md b/api/README.md index a46af83ce..e874b31a7 100644 --- a/api/README.md +++ b/api/README.md @@ -43,3 +43,20 @@ Or run continuously with pytest-testmon and pytest-watch (`ptw --runner "pytest ```bash make test-watch ``` + +### Troubleshooting + +**Poetry can't install rpy2** +Error: `ld: library not found for -lpcre2-8` + +pcre2 should be installed after running [mac.sh](../setup/mac.sh). This can be verified by running + +```bash +brew list pcre2 +``` + +This issue can be resolved by running the following command before `poetry_setup.sh`: (adjust path as necessary) + +```bash +export LIBRARY_PATH="/opt/homebrew/Cellar/pcre2/10.42/lib/:$LIBRARY_PATH" +``` From 61f255d1771dae7cf96a4c1bed5e4b6420540143 Mon Sep 17 00:00:00 2001 From: Brett Edwards Date: Thu, 7 Sep 2023 08:18:45 -0700 Subject: [PATCH 2/4] add greenlet and gdal to poetry --- api/README.md | 3 --- api/poetry.lock | 19 ++++++++++++++++--- api/pyproject.toml | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/api/README.md b/api/README.md index e874b31a7..7e0e11f3c 100644 --- a/api/README.md +++ b/api/README.md @@ -10,9 +10,6 @@ You will need an environment file. See: `.env.example`. Contact current maintain - then add run `eval "$(pyenv init -)"` in your current shell and add it to your `rc` file - then run `poetry_setup.sh` - then activate the virtual environment with `poetry shell` - - then run: - - python -m pip install gdal==$(gdal-config --version) - - pip install greenlet - Follow [vsc setup steps](../setup/VSC.md) - Manual (linux): See [manual setup](../docs/MANUAL_SETUP.md). Note: you may want to alias `python3` as `python` in your profile diff --git a/api/poetry.lock b/api/poetry.lock index 948e49b68..ec061f04e 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "affine" @@ -1272,6 +1272,19 @@ files = [ {file = "frozenlist-1.4.0.tar.gz", hash = "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251"}, ] +[[package]] +name = "gdal" +version = "3.7.1.1" +description = "GDAL: Geospatial Data Abstraction Library" +optional = false +python-versions = ">=3.6.0" +files = [ + {file = "GDAL-3.7.1.1.tar.gz", hash = "sha256:d16c6dab28eda6c4b1a571e6dc3e3b0fd824a0a6c1cc1947fc7dcb580c9999de"}, +] + +[package.extras] +numpy = ["numpy (>1.0.0)"] + [[package]] name = "geoalchemy2" version = "0.14.1" @@ -4603,7 +4616,7 @@ files = [ ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\""} +greenlet = {version = "!=0.4.17", markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""} typing-extensions = ">=4.2.0" [package.extras] @@ -5126,4 +5139,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.10.4,<3.11" -content-hash = "4ecd56c5e78f1f9b92f963d9788854f7247183e2922b51b07e2a0bcac6ee6410" +content-hash = "5b558d5556febd8b40cdabec9f3adf1e957850d47d0481511d050ed570664ae5" diff --git a/api/pyproject.toml b/api/pyproject.toml index 4ac5e1794..5137a27c6 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -42,6 +42,8 @@ rasterio = "^1.3.2" scikit-learn = "^1.1.3" httpx = "^0.24.0" orjson = "^3.9.0" +greenlet = "^2.0.2" +gdal = "3.7.*" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From 770c137d0028ded187a813e4261c9d7749ba726a Mon Sep 17 00:00:00 2001 From: Brett Edwards Date: Thu, 7 Sep 2023 08:28:28 -0700 Subject: [PATCH 3/4] remove gdal from poetry --- api/poetry.lock | 15 +-------------- api/pyproject.toml | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/api/poetry.lock b/api/poetry.lock index ec061f04e..dcb21f84d 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -1272,19 +1272,6 @@ files = [ {file = "frozenlist-1.4.0.tar.gz", hash = "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251"}, ] -[[package]] -name = "gdal" -version = "3.7.1.1" -description = "GDAL: Geospatial Data Abstraction Library" -optional = false -python-versions = ">=3.6.0" -files = [ - {file = "GDAL-3.7.1.1.tar.gz", hash = "sha256:d16c6dab28eda6c4b1a571e6dc3e3b0fd824a0a6c1cc1947fc7dcb580c9999de"}, -] - -[package.extras] -numpy = ["numpy (>1.0.0)"] - [[package]] name = "geoalchemy2" version = "0.14.1" @@ -5139,4 +5126,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.10.4,<3.11" -content-hash = "5b558d5556febd8b40cdabec9f3adf1e957850d47d0481511d050ed570664ae5" +content-hash = "68d09c22907b4b147fd546b6ed8371f03c9eb2e8769bc87a88d4899b58f577fa" diff --git a/api/pyproject.toml b/api/pyproject.toml index 5137a27c6..1af15c9ab 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -43,7 +43,6 @@ scikit-learn = "^1.1.3" httpx = "^0.24.0" orjson = "^3.9.0" greenlet = "^2.0.2" -gdal = "3.7.*" [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" From c6820c84fbc7ec6f66b930bf2790fb260dc6971e Mon Sep 17 00:00:00 2001 From: Brett Edwards Date: Thu, 7 Sep 2023 10:17:25 -0700 Subject: [PATCH 4/4] bring back gdal install instructions --- api/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/README.md b/api/README.md index 7e0e11f3c..f25a18b48 100644 --- a/api/README.md +++ b/api/README.md @@ -10,6 +10,8 @@ You will need an environment file. See: `.env.example`. Contact current maintain - then add run `eval "$(pyenv init -)"` in your current shell and add it to your `rc` file - then run `poetry_setup.sh` - then activate the virtual environment with `poetry shell` + - then run: + - python -m pip install gdal==$(gdal-config --version) - Follow [vsc setup steps](../setup/VSC.md) - Manual (linux): See [manual setup](../docs/MANUAL_SETUP.md). Note: you may want to alias `python3` as `python` in your profile