question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error using to_crs() -- no such file or directory - ONLY on windows

See original GitHub issue

Hi Colleagues. Some of my students are running into errors when they reproject using this code:

object.to_crs(another_object.crs)

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-5-eb6d1da3880a> in <module>()
----> 1 sjer_aoi_wgs84  = sjer_aoi.to_crs(sjer_roads.crs)

~\Anaconda3\envs\earth-analytics-python\lib\site-packages\geopandas\geodataframe.py in to_crs(self, crs, epsg, inplace)
    441         else:
    442             df = self.copy()
--> 443         geom = df.geometry.to_crs(crs=crs, epsg=epsg)
    444         df.geometry = geom
    445         df.crs = geom.crs

~\Anaconda3\envs\earth-analytics-python\lib\site-packages\geopandas\geoseries.py in to_crs(self, crs, epsg)
    302             except TypeError:
    303                 raise TypeError('Must set either crs or epsg for output.')
--> 304         proj_in = pyproj.Proj(self.crs, preserve_units=True)
    305         proj_out = pyproj.Proj(crs, preserve_units=True)
    306         project = partial(pyproj.transform, proj_in, proj_out)

~\Anaconda3\envs\earth-analytics-python\lib\site-packages\pyproj\__init__.py in __new__(self, projparams, preserve_units, **kwargs)
    356         # on case-insensitive filesystems).
    357         projstring = projstring.replace('EPSG','epsg')
--> 358         return _proj.Proj.__new__(self, projstring)
    359 
    360     def __call__(self, *args, **kw):

_proj.pyx in _proj.Proj.__cinit__()

RuntimeError: b'No such file or directory'

i have not been able to recreate it on my mac but can on windows 10. I found this issue which looks related: https://github.com/jswhit/pyproj/issues/101

and this SE post

https://gis.stackexchange.com/questions/295914/error-in-coordinate-transformation-with-geopandas

to which @jorisvandenbossche suggested removing proj4 and pyproj. i tried that but it did not fix the issue. also when you remove proj4 you have to remove gdal and rasterio and cartopy… so all of a sudden my environment is gone. I also did a full fresh reinstall of the environment.

Any ideas how I can resolve this issue? And why is it so windows specific!? note - i’m on a pretty fresh windows install and do not have arcgis or anything else here. just git, python / conda and a few other basic tools for text editins and such. im using python 3.x.

Many thanks for any suggestions.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:20 (16 by maintainers)

github_iconTop GitHub Comments

8reactions
gboeingcommented, Oct 2, 2018

On my machines I got it working via:

import os
os.environ["PROJ_LIB"] = "C:\Anaconda\envs\env_name\Library\share" #windows
os.environ["PROJ_LIB"] = ".../Anaconda/envs/env_name/Library/share" #linux
6reactions
jtameriuscommented, Oct 9, 2018

On my machines I got it working via:

import os
os.environ["PROJ_LIB"] = "C:\Anaconda\envs\env_name\Library\share" #windows
os.environ["PROJ_LIB"] = ".../Anaconda/envs/env_name/Library/share" #linux

This worked for me. Thanks @gboeing !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot open include file "windows.h" No such file or directory
Go to the project properties -> Configuration Properties -> General. then Change Platform Toolset to Visual Studio 2013- Windows XP(v120_xp) ...
Read more >
Profile loading fails - Windows Server - Microsoft Learn
Describes an issue in which profile loading fails when the ntuser.dat or usrclass.dat file is defined as read-only, or the profile user ...
Read more >
The Official TORCS FAQ (frequently asked questions)
4.2.5 TORCS does not compile with make: 'Make-config' is up to date. ... No such file or directory Can't open file data/img/splash-main.png Can't...
Read more >
"No such file or directory": problem with gitbash in Windows 10
I'm using vs code on Windows 10, but I'm using gitbash as my integrated terminal instead of the Windows shell. When using either...
Read more >
File Error: No such file or directory - eSilo - Data Backup For ...
If the file paths look like normal Windows paths with drive letters, such as "K:eSilo_SQL_Backupbackup.log No such file or directory"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found