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

Problem installing or updating to niche_vlaanderen-1.3 #382

Open
Wardlorenz opened this issue Aug 1, 2024 · 4 comments
Open

Problem installing or updating to niche_vlaanderen-1.3 #382

Wardlorenz opened this issue Aug 1, 2024 · 4 comments

Comments

@Wardlorenz
Copy link

I followed the installation as described in the Git-HUB tutorial.
When doing the installation via 'pip install niche_vlaanderen an error is produced making the installation unsuccesful and the model not functional. This happens with the installation of the newest version of niche_vlaanderen (1.3 - version.). And happens both with the command line "pip install niche_vlaanderen" and "pip install niche_vlaanderen-1.3"

The same error occurs for a couple of colleages of mine, trying the same installation (in miniconda, using windows operating system). One of the colleages succeeded in installing the 1.3 version about a month ago, but using the same computer couldn't reproduce the installation. All of us run into a bug at the same time when "PYGEOS" is collected/activated.

Underneath is the error that is produced.

We managed to install the niche_vlaanderen1.2 version, that seems to be still functional with the downloaded "zip package" of the niche_vlaanderen 1.3 version.

Is anyone else experiencing this problem, and is there a way solving it. What limitations can we expect using the outdated 1.2 version of the model?

Thanks in advance!

prtscr

_**Collecting pygeos (from niche_vlaanderen==1.3)
Using cached pygeos-0.14.tar.gz (141 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
C:\Users\wlorenz\AppData\Local\Temp\pip-install-a7uion6b\pygeos_b3b5606d5ed24b8a882c1afc14919a92\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
LONG_VERSION_PY['git'] = '''
Could not find geos-config executable. Either append the path to geos-config to PATH or manually provide the include_dirs, library_dirs, libraries and other link args for compiling against a GEOS version >=3.5.
Compiling pygeos/_geometry.pyx because it changed.
Compiling pygeos/_geos.pyx because it changed.
[1/2] Cythonizing pygeos/_geometry.pyx
[2/2] Cythonizing pygeos/_geos.pyx
Traceback (most recent call last):
File "C:\Users\wlorenz\Miniconda3\envs\niche\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\wlorenz\Miniconda3\envs\niche\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\wlorenz\Miniconda3\envs\niche\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\wlorenz\AppData\Local\Temp\pip-build-env-iwg3sjsg\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\wlorenz\AppData\Local\Temp\pip-build-env-iwg3sjsg\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "C:\Users\wlorenz\AppData\Local\Temp\pip-build-env-iwg3sjsg\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
exec(code, locals())
File "", line 214, in
File "C:\Users\wlorenz\AppData\Local\Temp\pip-install-a7uion6b\pygeos_b3b5606d5ed24b8a882c1afc14919a92\versioneer.py", line 1480, in get_version
return get_versions()["version"]
^^^^^^^^^^^^^^
File "C:\Users\wlorenz\AppData\Local\Temp\pip-install-a7uion6b\pygeos_b3b5606d5ed24b8a882c1afc14919a92\versioneer.py", line 1412, in get_versions
cfg = get_config_from_root(root)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\wlorenz\AppData\Local\Temp\pip-install-a7uion6b\pygeos_b3b5606d5ed24b8a882c1afc14919a92\versioneer.py", line 342, in get_config_from_root
parser = configparser.SafeConfigParser()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.**_

@johanvdw
Copy link
Collaborator

johanvdw commented Aug 2, 2024

Can you try installing pygeos using conda? ie conda install pygeos before running pip install niche_vlaanderen.

@Wardlorenz
Copy link
Author

Thanks Johan for the quick answer,

I tried to install Pygeos seperately in conda, which lead to a new error - mentioning that our python version is not-compatible with the installation of pygeos

Apparently Pygeos is (and will not) be updated to the python version of 3.12.

We can bypass this problem by running the niche environment in the python 3.9 version (apparently stated on the Github page).
Installation seems to be successful after this.

Thanks for the feedback!

@Sachagobeyn
Copy link

Sachagobeyn commented Sep 6, 2024

@johanvdw :

I tried with pinning the version on 3.9 (and 3.11). The install succeeds, yet a (unrelated?) GDAL warning occurs when running

niche --help

Output:

Warning 3: Cannot find header.dxf (GDAL_DATA is not defined)
Cannot find header.dxf (GDAL_DATA is not defined)
Usage: niche [OPTIONS] [CONFIG]

  Command line interface to the NICHE vegetation model

Options:
  --example  prints an example configuration file
  --version  prints the version number
  --help     Show this message and exit.

The model works, so I would assume this warning has no consequence

@johanvdw
Copy link
Collaborator

johanvdw commented Sep 10, 2024

@Sachagobeyn can you double check this error still occurs after reactivating the environment, cfr what is said here
"

You can verify the installation was successful by running the command line interface. Note you must activate niche once more, because some changes were made during installation."

The changes are actually defining these environment variables (GDAL_DATA and PROJ_DATA°.

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

3 participants