gpt4 book ai didi

macos - "brew install osm2pgsql"失败

转载 作者:行者123 更新时间:2023-11-29 13:33:35 34 4
gpt4 key购买 nike

我正在使用 mac,我想安装 osm2pgsql 以将 OSM 数据导入 PostgreSQL

我在终端中执行 brew install osm2pgsql。 (我已经执行了 brew update)。

这是输出:

==> Downloading https://github.com/openstreetmap/osm2pgsql/archive/v0.82.0.zip
Already downloaded: /Library/Caches/Homebrew/osm2pgsql-0.82.0.zip
==> ./autogen.sh
==> ./configure --with-proj=/usr/local/opt/proj
checking for fork... yes
checking for xml2-config... /usr/bin/xml2-config
checking for xml2 libraries... yes
checking for zlib compression library... no
configure: error: required library not found

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

下面是执行 brew doctor 的输出:

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libMonoPosixHelper.dylib
/usr/local/lib/libSFFileMonitor.32.dylib
/usr/local/lib/libSFIPC.32.dylib
/usr/local/lib/libSFIPC.I.dylib
/usr/local/lib/libSFsqlite3.7.4.dylib
/usr/local/lib/libSFSyncEngine.I.dylib

我不知道这些动态库,我应该删除它们吗?

我应该如何安装 osm2pgsql

或者我应该放弃 osm2pgsql 并使用其他工具将 OSM 数据导入 PostgreSQL 吗?

[编辑 1]

根据 http://www.zlib.net/ , zlib 已经包含在 Mac OS X 中。

当我在谷歌搜索时,我发现了这个 https://github.com/josegonzalez/homebrew-php/issues/205还有这个https://github.com/josegonzalez/homebrew-php/issues/538

所以我执行下面两条命令:

brew tap homebrew/dupes
brew install zlib

结果输出为:

==> Downloading http://zlib.net/zlib-1.2.8.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/zlib/1.2.8
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include

==> Summary

看来不用安装zlib了。

我再次执行 brew install osm2pgsql,但它仍然不起作用。

[编辑 2]

我放弃 Homebrew 软件并通过二进制安装程序安装 osm2pgsql。

仅供引用:
http://wiki.openstreetmap.org/wiki/Osm2pgsql#Binary_Installer https://github.com/openstreetmap/osm2pgsql/issues/15

最佳答案

我对 brew 一无所知,但根据错误消息,您缺少 zlib 库。尝试先安装它。

您应该继续使用 osm2pgsql,因为它是将 OSM 数据导入 PostgreSQL 数据库的标准工具。

关于macos - "brew install osm2pgsql"失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18325542/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com