Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: b'no system list, errno: 2\n' #100

Closed
mohmad-null opened this issue Dec 14, 2016 · 4 comments
Closed

RuntimeError: b'no system list, errno: 2\n' #100

mohmad-null opened this issue Dec 14, 2016 · 4 comments

Comments

@mohmad-null
Copy link

I've installed PyProj using the wheel from here - http://www.lfd.uci.edu/~gohlke/pythonlibs/ using pip, as I don't want to install a 3GB Visual Studio "runtime" to compile it myself.
I'm using Windows with Python 3.5 (x64).

However, when I try and run my transformation, I get this exception:

Traceback (most recent call last):
  File "E:/X_Dev/ogc__xml_to_es/src/xml_to_es.py", line 196, in <module>
    process_specified_project(args.index_name, args.proj_to_process)
  File "E:/X_Dev/ogc__xml_to_es/src/xml_to_es.py", line 183, in process_specified_project
    process_a_project(es, proj_to_process, PROJ_PATH, index_name)
  File "E:/X_Dev/ogc__xml_to_es/src/xml_to_es.py", line 140, in process_a_project
    post_processed = post_proc.post_process(parsed_content)
  File "E:\X_Dev\ogc__xml_to_es\src\post_process_xml.py", line 29, in post_process
    this_layer[key] = bbox_to_envelope(value, this_layer)
  File "E:\X_Dev\ogc__xml_to_es\src\post_process_xml.py", line 114, in bbox_to_envelope
    coords = change_coords(coords, start_proj, 'EPGS:4326')
  File "E:\X_Dev\ogc__xml_to_es\src\post_process_xml.py", line 181, in change_coords
    target = pyproj.Proj(init=target_proj)
  File "C:\Python35\lib\site-packages\pyproj\__init__.py", line 365, in __new__
    return _proj.Proj.__new__(self, projstring)
  File "_proj.pyx", line 117, in _proj.Proj.__cinit__ (_proj.c:1281)
RuntimeError: b'no system list, errno: 2\n'

Reading around suggests that this is because pyproj cannot find my /data directory. However it does exist and the pyproj.pyproj_datadir does have the correct path to it-

'C:\Python35\lib\site-packages\pyproj\data'

The data directory has 40 items totalling just over 5 MB.

I have tried explicitly doing:
pyproj.set_datapath(pyproj.pyproj_datadir)

But it still refuses to run. Am I doing something wrong, or is there something odd going on?

(reading around only found these:
https://sourceforge.net/p/py2exe/bugs/139/
http://stackoverflow.com/questions/20201532/issues-with-pyinstaller-and-pyproj
But neither directly relates to this issue as they're using alternative methods of installation)

@cgohlke
Copy link
Contributor

cgohlke commented Dec 15, 2016

Try:

  1. install the latest binaries from http://www.lfd.uci.edu/%7Egohlke/pythonlibs/#pyproj
  2. unset the PROJ_DIR environment variable if it is set.

@mohmad-null
Copy link
Author

Ok; I've found the error. I was reading in an external EPSG code and it was actually this:

'EPGS:4326'
Note the wrong ordering of EPSG. (don't you just hate the human habit of reading what it should say, not what it does say? :-) )

I'd suggest that the exception raised should be make it clear the problem is with the inability to find the specified EPSG code. Instead the error seems to be implying that it cannot find the database with the list of EPSG codes in it, which isn't the case.

@micahcochran
Copy link
Collaborator

That is a pretty nonspecific error. Pyproj is a python wrapper over proj.4. It does just a little bit of processing to the string before sending it to proj.4 as a string. pyproj really doesn't have much code that it relates to what projection it is sending. (It defaults to setting units to meters, which is sometimes problematic.)

pyproj itself has very little knowledge of the epsg file which is the EPSG code "database".

That error b'no system list, errno: 2\n', comes from proj.4.

This is very related to your other issue #101

@heitorPB heitorPB mentioned this issue Dec 29, 2018
@snowman2
Copy link
Member

Clearer exceptions have been added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants