Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi! I'm getting an error that my crs isn't valid (see this issue here.) I'm having the same issue as the second to most recent comment, using conda and with the Proj pointing to the postGIS installation of the proj.db. The issue runs all the way up the stack: pyproj, rasterio, etc. Are there any other ways to fix this than to uninstall postGIS? I need to be able to use both around the same time. Is there a way I can set the pointer in my env to the correct path? for me this would be
C:\Users\mikae\anaconda3\envs\geo_env\Library\share\proj.

I'm new to this and can't seem to figure out how to make it point to the correct proj.db file. Let me know what I can do/if more information is needed!

The error I get for reference:

CRSError: The EPSG code is unknown. PROJ: proj_create_from_database: C:\Program Files\PostgreSQL\10\share\contrib\postgis-3.2\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 0 whereas a number >= 2 is expected. It comes from another PROJ installation.

You must be logged in to vote

Replies: 2 comments · 7 replies

Comment options

The error you are running into is the same error mentioned here: https://pyproj4.github.io/pyproj/stable/gotchas.html#internal-proj-error-sqlite-error-on-select

Since you are using conda, the solution is to make sure you are using the conda activate command to activate your environment so the correct PROJ_LIB | PROJ_DATA environment variable is set to point to the correct location.

You must be logged in to vote
7 replies
@snowman2
Comment options

Do you have the PROJ_DATA or PROJ_LIB environment variables set?

@mikaelagordon
Comment options

I don't think so, how can I set those? sorry if that's a stupid question haha i don't know how to set those for a conda environment

@snowman2
Comment options

They should be set when you activate your conda environment. Example here: https://pyproj4.github.io/pyproj/stable/installation.html. Just replace pyproj with rasterio.

@mikaelagordon
Comment options

Ok, I have noticed something interesting while trying to do things. the path is correct when running the following command and nothing else:
image

BUT, after playing around with a bunch of things, it seems like the path changes as soon as I read in a file using geopandas.read_file. Do you know any reason this might be the case???
image

I tested what I was trying to do without using geopandas.read_file, and what I was trying to do worked. the path never changed to the incorrect one. Not sure how or why this would happen or what kind of workaround there could be, it's very confusing. How can I not have it change?

@snowman2
Comment options

Possibly related: conda-forge/pyproj-feedstock#130

Comment options

Hi, check the FAQs of rasterio packages to ensure libraries incompatibilies are dealt with:

https://rasterio.readthedocs.io/en/stable/faq.html#why-can-t-rasterio-find-proj-db-rasterio-versions-1-2-0

https://rasterio.readthedocs.io/en/stable/faq.html#why-can-t-rasterio-find-proj-db-rasterio-from-pypi-versions-1-2-0

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.