在Ubuntu 22.04上运行MapProxy 1.15.1



我试图在Ubuntu 22.04上安装MapProxy 1.15.1。我大致遵循了来自mapproxy.org的安装文档,似乎不完全兼容并且有点过时。

总而言之,它不起作用。我得到了

# mapproxy-util --version
Traceback (most recent call last):
File "/root/mapproxy/bin/mapproxy-util", line 5, in <module>
from mapproxy.script.util import main
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/script/util.py", line 29, in <module>
from mapproxy.script.conf.app import config_command
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/script/conf/app.py", line 32, in <module>
from .sources import sources
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/script/conf/sources.py", line 17, in <module>
from mapproxy.srs import SRS
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/srs.py", line 26, in <module>
from mapproxy.proj import USE_PROJ4_API
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/proj.py", line 282, in <module>
res = try_import()
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/proj.py", line 155, in try_libproj_import
libproj = init_libproj()
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/proj.py", line 58, in init_libproj
libproj = load_library('libproj')
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/util/lib.py", line 65, in load_library
lib = load_library_(lib_name, locations_conf)
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/util/lib.py", line 69, in load_library_
lib_path = find_library(lib_name)
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/util/lib.py", line 93, in find_library
lib = _find_library(lib_name)
File "/usr/lib/python3.10/ctypes/util.py", line 341, in find_library
_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
File "/usr/lib/python3.10/ctypes/util.py", line 147, in _findLib_gcc
if not _is_elf(file):
File "/usr/lib/python3.10/ctypes/util.py", line 99, in _is_elf
with open(filename, 'br') as thefile:
FileNotFoundError: [Errno 2] No such file or directory: b'liblibproj.a'

我从util.py中得到的似乎是,它打算首先尝试带有前置"lib"然后没有。然而,由于某些原因,它以一个异常停止,而不是继续尝试。这在Github上也提到过,但没有回应。

我尝试了各种方法来解决这个问题,例如修补代码并放置符号链接。他们都有部分工作。我遇到了下一个错误:

# mapproxy-util --version
Found libproj >=5. Using this library without pyproj is deprecated and not fully supported. Please install pyproj >= 2.
Traceback (most recent call last):
File "/root/mapproxy/bin/mapproxy-util", line 5, in <module>
from mapproxy.script.util import main
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/script/util.py", line 29, in <module>
from mapproxy.script.conf.app import config_command
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/script/conf/app.py", line 32, in <module>
from .sources import sources
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/script/conf/sources.py", line 17, in <module>
from mapproxy.srs import SRS
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/srs.py", line 26, in <module>
from mapproxy.proj import USE_PROJ4_API
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/proj.py", line 282, in <module>
res = try_import()
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/proj.py", line 155, in try_libproj_import
libproj = init_libproj()
File "/root/mapproxy/lib/python3.10/site-packages/mapproxy/proj.py", line 66, in init_libproj
libproj.pj_init_plus.argtypes = [c_char_p]
File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/x86_64-linux-gnu/libproj.so.22: undefined symbol: pj_init_plus

总之,Ubuntu 22.04上的几个软件包似乎与MapProxy不兼容。我现在已经想不出如何解决这个问题了。我可能需要旧版本的libproj,但我的知识不足以安装并行版本的POSIX库。有更好/简单的解决办法吗?

附录:我希望一些用户创建一个标签,并将其添加到这里。我做不到。

如果mapproxy-util --version给出错误,尝试

pip install pyproj

相关内容

  • 没有找到相关文章

最新更新