我正在尝试使用安装 RMySQL 包
bash > R
...
> install.packages('RMySQL', repos='http://cran.us.r-project.org')
并在最后得到以下错误输出:
Installing package into ‘/usr/local/lib/R/3.2/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/RMySQL_0.10.6.tar.gz'
Content type 'application/x-gzip' length 52407 bytes (51 KB)
==================================================
downloaded 51 KB
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64
Using PKG_LIBS=-L/usr/local/mysql/lib -lmysqlclient
** libs
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c RMySQL-init.c -o RMySQL-init.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c connection.c -o connection.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c db-apply.c -o db-apply.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c driver.c -o driver.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c exception.c -o exception.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c fields.c -o fields.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c result.c -o result.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c utils.c -o utils.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L/usr/local/mysql/lib -lmysqlclient -F/usr/local/Cellar/r/3.2.2_1/R.framework/.. -framework R -lintl -Wl,-framework -Wl,CoreFoundation
installing to /usr/local/lib/R/3.2/site-library/RMySQL/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/lib/R/3.2/site-library/RMySQL/libs/RMySQL.so':
dlopen(/usr/local/lib/R/3.2/site-library/RMySQL/libs/RMySQL.so, 6): Library not loaded: libmysqlclient.18.dylib
Referenced from: /usr/local/lib/R/3.2/site-library/RMySQL/libs/RMySQL.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/3.2/site-library/RMySQL’
The downloaded source packages are in
‘/private/var/folders/87/wkgwm0754tn9csz8295qjmmc000bxz/T/RtmpxlEAlo/downloaded_packages’
Warning message:
In install.packages("RMySQL", repos = "http://cran.us.r-project.org") :
installation of package ‘RMySQL’ had non-zero exit status
>
> install.packages('RMySQL', repos='http://cran.us.r-project.org')
Installing package into ‘/usr/local/lib/R/3.2/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/RMySQL_0.10.6.tar.gz'
Content type 'application/x-gzip' length 52407 bytes (51 KB)
==================================================
downloaded 51 KB
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64
Using PKG_LIBS=-L/usr/local/mysql/lib -lmysqlclient
** libs
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c RMySQL-init.c -o RMySQL-init.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c connection.c -o connection.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c db-apply.c -o db-apply.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c driver.c -o driver.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c exception.c -o exception.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c fields.c -o fields.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c result.c -o result.o
clang -I/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/include -DNDEBUG -I/usr/local/mysql/include -g -fno-omit-frame-pointer -fno-strict-aliasing -arch x86_64 -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -fPIC -g -O2 -c utils.c -o utils.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L/usr/local/mysql/lib -lmysqlclient -F/usr/local/Cellar/r/3.2.2_1/R.framework/.. -framework R -lintl -Wl,-framework -Wl,CoreFoundation
installing to /usr/local/lib/R/3.2/site-library/RMySQL/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/lib/R/3.2/site-library/RMySQL/libs/RMySQL.so':
dlopen(/usr/local/lib/R/3.2/site-library/RMySQL/libs/RMySQL.so, 6): Library not loaded: libmysqlclient.18.dylib
Referenced from: /usr/local/lib/R/3.2/site-library/RMySQL/libs/RMySQL.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/3.2/site-library/RMySQL’
The downloaded source packages are in
‘/private/var/folders/87/wkgwm0754tn9csz8295qjmmc000bxz/T/RtmpxlEAlo/downloaded_packages’
Warning message:
In install.packages("RMySQL", repos = "http://cran.us.r-project.org") :
installation of package ‘RMySQL’ had non-zero exit status
任何想法?