#744 closed defect (invalid)
pyproj (python3-pyproj) not working in QGIS
Reported by: | andreaerdna | Owned by: | |
---|---|---|---|
Priority: | major | Component: | Package |
Version: | Keywords: | ||
Cc: |
Description
The pyproj Pytohn module (python3-pyproj 3.3.1-1) does not work in QGIS.
It seems to me this is due to the fact that the python3-pyproj package needs the proj82-runtime package but proj82-runtime is no longer listed in the python3-pyproj dependencies as it was previously.
Manually installing proj82-runtime fixes the issue.
The same underlying issue (missing proj82-runtime as dependency) makes it impossible to launch GRASS GIS 8 (see #738) or use GRASS 8 plugin in QGIS (see #743).
Change History (5)
comment:1 by , 3 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 3 years ago
With a fresh install of QGIS Desktop 3.24.2 (qgis-full 3.24.2-2) using OSGeo4W, the python3-pyproj package is installed, the proj90-runtime package is installed and the proj82-runtime package is not installed.
The following Python commands (from https://pyproj4.github.io/pyproj/stable/examples.html) in the QGIS Python console:
from pyproj import CRS crs = CRS.from_epsg(4326)
generate the following error:
Traceback (most recent call last): File "C:\OSA194~1\apps\Python39\lib\code.py", line 90, in runcode exec(code, self.locals) File "<input>", line 1, in <module> File "C:\OSA194~1\apps\Python39\lib\site-packages\pyproj\crs\crs.py", line 379, in from_epsg return cls.from_user_input(_prepare_from_epsg(code)) File "C:\OSA194~1\apps\Python39\lib\site-packages\pyproj\crs\crs.py", line 488, in from_user_input return cls(value, **kwargs) File "C:\OSA194~1\apps\Python39\lib\site-packages\pyproj\crs\crs.py", line 335, in __init__ self._local.crs = _CRS(self.srs) File "pyproj\_crs.pyx", line 2352, in pyproj._crs._CRS.__init__ pyproj.exceptions.CRSError: Invalid projection: epsg:4326: (Internal Proj Error: proj_create: no database context specified)
After manually installing the proj82-runtime package, the same following Python commands in the QGIS Python console:
from pyproj import CRS crs = CRS.from_epsg(4326)
doesn't generate any error message.
comment:3 by , 3 years ago
Hm, not reproducable here. Neither with python3-pyproj alone nor qgis-full - from the shell or qgis python console.
comment:4 by , 3 years ago
Thanks for looking at this. Actually the issue is not due to the lack of the proj82-runtime package, but to the install/uninstall procedure of the proj*-runtime packages.
In fact, when the proj90-runtime is originally installed, then the proj_9_0.dll file is put in the bin folder and the proj.bat file in etc/ini and proj.db, proj.ini and other files in share/proj.
If afterwards the proj82-runtime package is installed, then the proj_8_2.dll file is put in the bin folder, alongside proj_9_0.dll already present, and proj.bat, proj.db, proj.ini and other files are overwritten.
When the proj82-runtime package is uninstalled, then the proj_8_2.dll file is removed (correctly leaving the proj_9_0.dll file in place) but are are also removed the proj.bat, proj.db, proj.ini and the other files.
So now the system has again only the proj90-runtime with the proj_9_0.dll in the bin folder, but now the proj.bat, proj.db, proj.ini and other files are missing, so pyproj and other PROJ stuff will not correctly work because needed files are missing.
So, to replicate the reported issue, do a fresh installation of qgis-full (the proj90-runtime will be automatically installed), then manually install proj82-runtime (or any other proj*-runtime package) and remove it afterwards.
comment:5 by , 3 years ago
proj90-runtime now only contains the DLL and depends on new proj-runtime-data. So for future version this should be fixed.
python3-pyproj 3.3.1-1 doesn't depends on proj82-runtime.