GeoDjango 设置:错误:无法访问文件“$libdir/postgis-1.5”:没有这样的文件或目录
更新:以为我已经解决了它,但我没有......请参见下文。
我正在 Mac OSX 上安装 GeoDjango。我已按照 Mac 安装说明,一切都很顺利,现在为 PostGIS 创建空间数据库模板。
但是,当我尝试加载 PostGIS SQL 例程时,出现错误:无法访问文件“$libdir/postgis-1.5”:没有这样的文件或目录:
postgres$ psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
psql:/usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql:59: ERROR: could not access file "$libdir/postgis-1.5": No such file or directory
<snip>
psql:/usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql:7785: ERROR: type "geometry" does not exist
出了什么问题,我该怎么办修复它吗?
我发现这些来自postgis IRC的说明,但我想我正在运行正确版本的 pg_config 等:
postgres$ which pg_config
/usr/local/pgsql/bin//pg_config
postgres$ which psql
/usr/local/pgsql/bin//psql
postgres$ pg_config --pkglibdir
/usr/local/pgsql/lib
我从 KyngChaos 安装了 postgres 及其 PostGIS 扩展。如果我查看 /usr/local/pgsql/lib
,那里有一个名为 postgis-1.5.so
的文件,所以我不明白为什么没有找到它。
Update: thought I'd solved it, but I hadn't... please see below.
I'm installing GeoDjango on Mac OSX. I've followed the Mac install instructions, which all went smoothly, and am now creating a spatial database template for PostGIS.
However, when I try to load the PostGIS SQL routines, I get ERROR: could not access file "$libdir/postgis-1.5": No such file or directory
:
postgres$ psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
psql:/usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql:59: ERROR: could not access file "$libdir/postgis-1.5": No such file or directory
<snip>
psql:/usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql:7785: ERROR: type "geometry" does not exist
What's going wrong, and how can I fix it?
I found these instructions from postgis IRC, but I think I'm running the right version of pg_config, etc:
postgres$ which pg_config
/usr/local/pgsql/bin//pg_config
postgres$ which psql
/usr/local/pgsql/bin//psql
postgres$ pg_config --pkglibdir
/usr/local/pgsql/lib
I installed postgres and its PostGIS extensions from KyngChaos. If I look in /usr/local/pgsql/lib
, there is a file called postgis-1.5.so
there, so I don't understand why it's not being found.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个老问题,但我使用谷歌发现了它,所以其他人也可能会在这里结束。
在我的 Mac OSX macports 安装上,我有两个包含 postgresql .so 文件的文件夹:
并且
似乎我的安装在 /opt/local/lib/postgresql90/ 中查找,而不是在 /usr/local/pgsql-9.0/lib/ 中,所以要安装 pg_trgm,我必须执行以下操作:
这应该适用于任何不在正确位置的 .so 文件 - 在你的示例中它会
允许我安装 postgis :)
I know this an old question, but i found it using Google, so others might end up here as well.
On my Mac OSX macports install, i had two folders with .so files for postgresql:
and
It seems like my installation looked in /opt/local/lib/postgresql90/ and not in /usr/local/pgsql-9.0/lib/, so to install pg_trgm, i had to do the following:
This should work with any .so file which is not in the right place - In your example it would have been
Which allows me to install postgis as well :)
文件 /usr/local/Cellar/postgresql9/9.0.17/lib/postgis-1.5.so 丢失。这个错误发生在brew升级之后,解决方案是卸载postgis并重新安装它:
brew uninstall postgis15brew
install postgis15
结果应该是:PostGIS插件库安装到:/usr/local/Cellar/postgresql9/9.0.17/lib
所以之后你应该找到文件 /usr/local/Cellar/postgresql9/9.0.17/lib/postgis-1.5.so
The file /usr/local/Cellar/postgresql9/9.0.17/lib/postgis-1.5.so is missing. This error happened after brew upgrade and the solution is to uninstall postgis and reinstall it with:
brew uninstall postgis15
brew install postgis15
The result should be: PostGIS plugin libraries installed to: /usr/local/Cellar/postgresql9/9.0.17/lib
So afterwards you should find the file /usr/local/Cellar/postgresql9/9.0.17/lib/postgis-1.5.so