Closed solisgb closed 3 years ago
Hey @solisgb, thanks for reporting. As far as I can see, the error you reported above has nothing to do with Spyder but with pyproj.
Unless you're able to better determine why Spyder is failing, I'm afraid we won't be able to help you, sorry.
Hi Cordoba12:
Thanks for your interest
I'm confused with this
When I call the function from Spyder, the first line that tries to execute the pyproj module raises module an error, but the function runs correctly when I call the exact same function in Jupyter lab. As the Python enviroment is the same, I assumed that the result should be the same. Perhaps you could tell me what kind of additional information I can send you, because I am completely confused with this behavior.
I'm really sorry but we I have no idea what happens here. What you're asking us to do is to debug this problem for you, which doesn't seem to be located in Spyder (as I said).
Unfortunately, we don't have time for that.
In the same conda environment, if a I run a function in Jupyter lab using pyproj module it runs correctly, but if I try in Syper it raises an error
OS Windows 10. Python 3.8, conda 4.9.2, spyder 4.2.0, pyproj 3.0.1. I also have QGIS 3.16.6
The complete function is:
This is the first error, as you know, 4258 and 25830 are both valid epsg codes File "C:\Users...\gis_utils\gis_utils.py", line 31, in geographics2proyected if proj.crs.CRS(crsg).is_projected: File "C:\Users\solis\miniconda3\envs\env01\lib\site-packages\pyproj\crs\crs.py", line 296, in init super().init(projstring) File "pyproj_crs.pyx", line 2309, in pyproj._crs._CRS.init pyproj.exceptions.CRSError: Invalid projection: epsg:4258: (Internal Proj Error: proj_create: cannot build geodeticCRS 4258: SQLite error on SELECT extent.description, extent.south_lat, extent.north_lat, extent.west_lon, extent.east_lon, scope.scope, (CASE WHEN scope.scope LIKE '%large scale%' THEN 0 ELSE 1 END) AS score FROM usage JOIN extent ON usage.extent_auth_name = extent.auth_name AND usage.extent_code = extent.code JOIN scope ON usage.scope_auth_name = scope.auth_name AND usage.scope_code = scope.code WHERE object_table_name = ? AND object_auth_name = ? AND object_code = ? ORDER BY score, usage.auth_name, usage.code: no such table: usage)
From a jupiter notebook I can run this function but not under Syper env.
def main
I'd appreciate very much your help