[osgeo4w-dev] [osgeo4w] #744: pyproj (python3-pyproj) not working in QGIS

OSGeo4W trac_osgeo4w at osgeo.org
Tue May 10 04:13:17 PDT 2022


#744: pyproj (python3-pyproj) not working in QGIS
------------------------+----------------------------
Reporter:  andreaerdna  |       Owner:  osgeo4w-dev@…
    Type:  defect       |      Status:  closed
Priority:  major        |   Component:  Package
 Version:               |  Resolution:  invalid
Keywords:               |
------------------------+----------------------------
Comment (by andreaerdna):

 With a fresh install of QGIS Desktop 3.22.4 (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.
-- 
Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/744#comment:2>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list