I'm testing MapProxy (1.12.0) on a Windows Machine and followed each step from the "Installation on Windows" docs. I have a running virtualenv, used pip to install MapProxy and PyProj.

The command pip list shows

MapProxy   1.12.0
Pillow     6.2.0
pip        19.2.3
pyproj     2.4.2.post1
PyYAML     5.1.2
setuptools 41.4.0
Shapely    1.6.4.post2
wheel      0.33.6

A simple mapproxy-util --version fails with the following traceback:

(mapproxy_venv) \mymapproxy>mapproxy-util --version
Traceback (most recent call last):
  File "\python\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "\python\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "\mapproxy_venv\Scripts\mapproxy-util.exe\__main__.py", line
5, in <module>
  File "\mapproxy_venv\lib\site-packages\mapproxy\script\util.py", l
ine 28, in <module>
    from mapproxy.script.conf.app import config_command
  File "\mapproxy_venv\lib\site-packages\mapproxy\script\conf\app.py
", line 32, in <module>
    from .sources import sources
  File "\mapproxy_venv\lib\site-packages\mapproxy\script\conf\source
s.py", line 17, in <module>
    from mapproxy.srs import SRS
  File "\mapproxy_venv\lib\site-packages\mapproxy\srs.py", line 26,
in <module>
    from mapproxy.proj import Proj, transform, set_datapath
  File "\mapproxy_venv\lib\site-packages\mapproxy\proj.py", line 262
, in <module>
    raise ImportError('could not find libproj or pyproj')
ImportError: could not find libproj or pyproj

Any ideas what went wrong? PyProj import and functions are working, tested that in the python console.

  • 1
    I have the exact same problem. Does it work in earlier versions? – Stefan Dec 5 '19 at 15:37

My guess is that your pyproj is too new. I reinstalled my setup on a different computer and had to roll back all the way to pyproj 1.9.6.

I haven't dug deeper into it, but i think that pyproj has renamed something, as it is the line:

from pyproj import Proj, transform, set_datapath

that throws an exception.

After changing to pyproj 1.9.6 it works. In order to do that I also changed to python 3.7 as I'm lazy and wanted to use a precomiled package.

  • Thank you very much, that was the problem. MapServer should update their docs or the code... – baal Dec 9 '19 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.