Problems with pyinstaller and pyproj

I am trying to make a standalone application with pyinstaller. The executable just works just fine, but when I try to perform some operations with functions integrated into the pyproj library, the executable fails.

w370> works fine on Pycharm, so I think the problem is that pyinstaller is not communicating with some pyproj library.

Can I do something special with a spec file or something else to point pyproj to a standalone application built with pyinstaller?

This is the error I received:

Traceback (most recent call last):   File "<string>", line 6, in
<module>   File "C:\pyproj\build\main\out00-PYZ.pyz\pyproj", line 343,
in __new__   File "_proj.pyx", line 85, in _proj.Proj.__cinit__
(_proj.c:1190) 
RuntimeError: no system list, errno: 2

This is my "main.py"

 #!/usr/bin/env python
 # -*- coding: utf-8 -*-

 import pyproj 
 print pyproj.__version__ 
 p=pyproj.Proj(init='EPSG:4326')

Thank you in advance

+4
source share
3 answers

, pyproj PyInstaller pyproj , .

-, , .

 hook-pyproj.py

 from PyInstaller.hooks.hookutils import collect_data_files
 datas = collect_data_files('pyproj')

- "hooks" Pyinstaller -additional-hooks-dir, , "hook-pyproj.py"

+3

, 2014 PyInstaller , hook :

from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('pyproj')
+1
from PyInstaller.hooks.hookutils import collect_data_files
 datas = collect_data_files('pyproj')
  • . .

But I found in another thread that the problem can be solved with this:

from mpl_toolkits.basemap import pyproj as pyproj

pyinstaller seems to have problems integrating the pyproj module itself, but basemap includes pyproj and pyinstaller is not ignored.

Just for update

0
source

All Articles