1

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
  • 1
    I have the exact same problem. Does it work in earlier versions?
    – Stefan
    Dec 5, 2019 at 15:37

2 Answers 2

2

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.

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

To add to Stefan's answer and Baal's comment, I needed these additional commands to make proj 1.9.6 available. (Confirming his suggestion was my issue too) The Make and GCC stuff wasn't obvious to me when I started doing this - in case any of you attempting MapProxy are linux noobs like me :)

sudo pip3 install wheel
sudo pip3 install setuptools
sudo pip3 install pyyaml
sudo dnf install gcc make
sudo dnf install python3-devel
sudo pip3 install 'pyproj==1.9.6'

Now I get this:

[me@localhost ~]$ mapproxy-util --version
MapProxy 1.13.2
[me@localhost ~]$ 

One More thing: If you are like me and testing with a headless VM, with no browsing capabilities, the binding made when doing this is to a 'localhost' host header:

mapproxy-util serve-develop mapproxy.yaml

This method doesn't allow someone from a different IP (my actual OS vm) access to the server. You may need this:

mapproxy-util serve-develop mapproxy.yaml -b <vm-ip>:8080

Now it works. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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