pyproj4 / pyproj

Python interface to PROJ (cartographic projections and coordinate transformations library)
https://pyproj4.github.io/pyproj
MIT License
1.04k stars 210 forks source link

DeprecationWarning: pkg_resources is deprecated as an API. #1366

Closed DSpils closed 7 months ago

DSpils commented 7 months ago

Installation method/steps

Environment Information

My installation of pyproj 2.5.0 (and other versions) keep failing, can somebody help me? I already downgraded setuptools to version 50.0.0 but that didn't work.

The error message: pip install pyproj==2.5.0 Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pyproj==2.5.0 Using cached pyproj-2.5.0.tar.gz (508 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 ╰─> [51 lines of output]

:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html Error compiling Cython file: ------------------------------------------------------------ ... cdef void pyproj_context_initialize(PJ_CONTEXT* context, bint free_context_on_error) except *: """ Setup the context for pyproj """ proj_log_func(context, NULL, pyproj_log_function) ^ ------------------------------------------------------------ pyproj/_datadir.pyx:37:33: Cannot assign type 'void (void *, int, const char *) except *' to 'PJ_LOG_FUNCTION'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, const char *) except *'. Error compiling Cython file: ------------------------------------------------------------ ... proj_context_destroy(context) raise def pyproj_global_context_initialize(): proj_log_func(NULL, NULL, pyproj_log_function) ^ ------------------------------------------------------------ pyproj/_datadir.pyx:49:30: Cannot assign type 'void (void *, int, const char *) except *' to 'PJ_LOG_FUNCTION'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, const char *) except *'. Traceback (most recent call last): File "/home/debian/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/home/debian/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/home/debian/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "/tmp/pip-build-env-6nl2cif9/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "/tmp/pip-build-env-6nl2cif9/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-6nl2cif9/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 480, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "/tmp/pip-build-env-6nl2cif9/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 244, in File "", line 159, in get_extension_modules File "/tmp/pip-build-env-6nl2cif9/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize cythonize_one(*args) File "/tmp/pip-build-env-6nl2cif9/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: pyproj/_datadir.pyx [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.
snowman2 commented 7 months ago

Duplicate: https://github.com/pyproj4/pyproj/issues/1313

Resolution: Upgrade pyproj