3

I'm running R version 2.14.1 on Linux. When I try to install sqldf with

install.packages(sqldf, dependencies=TRUE)

I get the following errors: (these errors result in running the command from the terminal as with the use of the Rcmdr UI)

open log here

I can't seem to find someone with a similar problem. If I run the install command on a Windows PC, it installs without any problems.

Kara
  • 6,115
  • 16
  • 50
  • 57
Max van der Heijden
  • 1,095
  • 1
  • 8
  • 16
  • A quick look brings up fatal error: libpq-fe.h: No such file or directory. Install libpq-dev and try it again – Jeff_Hd Aug 07 '12 at 15:22
  • Did you read through the log? Do you have a proper jdk installed? Did you try doing `R CMD javareconf`? What have you done so far? It seems there are quite a few issues that need to be resolved. – Dason Aug 07 '12 at 15:22
  • Did you try to read the log you posted? – Dirk Eddelbuettel Aug 07 '12 at 15:23
  • 1
    Both the `INSTALL` file that comes with the sqldf package (and is linked to from its CRAN page: http://cran.r-project.org/package=sqldf) and the sqldf home page (http://sqldf.googlecode.com) recommend that you use `install.packages("sqldf")` . Its unlikely that you need every database that sqldf supports so just install the ones that you need (or don't install any in which case it still pulls in sqlite automatically). – G. Grothendieck Aug 07 '12 at 18:50
  • java seemed to be installed incorrectly, I installed it again. I've also installed the libpq-dev package, I now get the following error: Warning: dependency ‘gsubfn’ is not available. If I try to install gsubfn separately I get the rror that gsubfn is not available for R version 2.14.1 – Max van der Heijden Aug 07 '12 at 19:04
  • 1
    Its time to upgrade R to the latest version. – G. Grothendieck Aug 07 '12 at 19:15
  • Indeed. updated and working like a charm! – Max van der Heijden Aug 07 '12 at 19:40

3 Answers3

6

You error log has the line:

In file included from RS-PQescape.c:7:0:
RS-PostgreSQL.h:23:26: fatal error: libpq-fe.h: No such file or directory
compilation terminated.
make: *** [RS-PQescape.o] Error 1

Try installing the libpq-dev package for your particular linux distribution.


As an aside, when you get an error like this, it's fairly clear that libpq-fe.h is missing. Just type libpq-fe.h ubuntu into google to see what package you need to install.

csgillespie
  • 59,189
  • 14
  • 150
  • 185
0

Installed libpq-dev, MySQL, reinstalled JAVA and updated R to the latest version. SQLdf is now working like a charm. Thanks for the heads up everybody.

Max van der Heijden
  • 1,095
  • 1
  • 8
  • 16
0

I just did almost almost what you had but with "sqldf" in the interactive R terminal and everything went ok

install.packages("sqldf", dependencies=TRUE)
Pepe Alvarez
  • 1,218
  • 1
  • 9
  • 15