2014-03-31 235 views
0

我正在嘗試將形狀文件導入到postgis中。我有問題配置shp2pgsql。'shp2pgsql'無法識別:找不到命令錯誤

我收到此錯誤:

-bash: shp2pgsql: command not found 

我也沒有得到任何結果就像閱讀不同的線程:https://github.com/Homebrew/homebrew/issues/19213

macbook$ locate shp2pgsql 
/Library/PostgreSQL/9.3/PostGIS/man/shp2pgsql.1 
/Library/PostgreSQL/9.3/bin/shp2pgsql 
/usr/bin/shp2pgsql 

macbook$ otool -L shp2psql 
otool: can't open file: shp2psql (No such file or directory) 

我試圖運行該命令

macbook$ which shp2pgsql 

我什麼都沒有。

macbook$ ls /usr/bin/shp2pgsql 
/usr/bin/shp2pgsql 

首先猜測是「shp2pgsql」未鏈接。我怎樣才能在Postgres的PostgreSQL的鏈接/ usr/bin中/ shp2pgsql當我試圖運行:

sudo ln -s /Library/PostgreSQL/9.3/bin/shp2pgsql /usr/bin/shp2pgsql 
It says that : : ln: /usr/bin/shp2pgsql: File exists 

UPDATE 當我掛shp2pgsql

dyld: Library not loaded: @loader_path/../lib/liblwgeom-2.1.1.dylib 
    Referenced from: /Library/PostgreSQL/9.3/bin/shp2pgsql 
    Reason: image not found 

當我試圖找到liblwgeom

macbook$ locate liblwgeom 
/Library/Caches/Homebrew/Formula/liblwgeom.brewing 
/Library/Caches/Homebrew/liblwgeom-2.1.1.tar.gz 
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom-2.1.1.dylib 
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom.a 
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom.dylib 
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom.la 
/usr/local/Cellar/liblwgeom 
/usr/local/Cellar/liblwgeom/2.1.1 
/usr/local/Cellar/liblwgeom/2.1.1/COPYING 
/usr/local/Cellar/liblwgeom/2.1.1/ChangeLog 
/usr/local/Cellar/liblwgeom/2.1.1/INSTALL_RECEIPT.json 
/usr/local/Cellar/liblwgeom/2.1.1/LICENSE.TXT 
/usr/local/Cellar/liblwgeom/2.1.1/NEWS 
/usr/local/Cellar/liblwgeom/2.1.1/TODO 
/usr/local/Cellar/liblwgeom/2.1.1/include 
/usr/local/Cellar/liblwgeom/2.1.1/include/liblwgeom.h 
/usr/local/Cellar/liblwgeom/2.1.1/lib 
/usr/local/Cellar/liblwgeom/2.1.1/lib/liblwgeom-2.1.1.dylib 
/usr/local/Cellar/liblwgeom/2.1.1/lib/liblwgeom.a 
/usr/local/Cellar/liblwgeom/2.1.1/lib/liblwgeom.dylib 
/usr/local/Library/Formula/liblwgeom.rb 
/usr/local/opt/liblwgeom 

任何想法如何解決這個問題。

回答

1

在你的bash控制檯中寫回聲$ PATH並告訴我們它說了什麼。 也許這可以通過

PATH=$PATH:/Library/PostgreSQL/9.3/bin/ 
export PATH 
+0

由於是固定的!看來我已經丟失的文件(首先檢查更新)。這裏是一樣的:https://github.com/Homebrew/homebrew/issues/19213。但是這個帖子沒有解決 – user3378649

相關問題