tomoakin / RPostgreSQL

Automatically exported from code.google.com/p/rpostgresql
64 stars 19 forks source link

Unable to locate required modules/DLLs #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem occurs when library(RPostgreSQL) is issued on R. This issue has 
previously appeared on R mailing list without any robust solution. The error 
message issued by R:

Loading required package: RPostgreSQL
Loading required package: DBI
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared library 'C:/PROGRA~1/R/R-210~1.1/library/RPostgreSQL/libs/RPostgreSQL.dll':
  LoadLibrary failure:  Unable to locate the specified module.
Error: package 'RPostgreSQL' could not be loaded

At the same time an error box appears saying that a given DLL does not exists 
which makes RPostgreSQL loading to fail. The message appears for any of the 
following DLLs (that actually exist on 
X:/PostgreSQL_installation_directory/bin):

libpq.dll
ssleay32.dll
libeay32.dll
libintl-8.dll
libiconv-2.dll
krb5_32.dll
comerr32.dll
k5sprt32.dll
msvcr71.dll
gssapi32.dll

To "solve" this problem the actual DLLs from the PostgreSQL installation 
directory must be copied into the X:/WINDOWS/System32 shared libraries folder 
in order to make the package operational.
Is there a way to solve this from the package internals without having to copy 
the DLLs? Am I missing something here?

I'm using R-2.11.1 on WinXP/7.

Original issue reported on code.google.com by joao...@gmail.com on 29 Jun 2010 at 10:36

GoogleCodeExporter commented 9 years ago
It sounds like either you did not properly adjust your Windows PATH for R or 
you have a DLL conflict problem caused by incorrectly installd DLLS from other 
software. 

You should use a DLL dependency tracker software to see what the exact DLL 
conflict is and where. You may have to uninstall offending software that 
installed DLLS in the wrong place. 

For what it is worth, if this is a DLL issue, there is no robust solution since 
DLL conflicts are always a Windows issue in how the system's cavalier method 
works allowing software vendors to install DLLS anyplace they want. Every time 
I had this happen it was caused by some other program dumping (usually older) 
copies of shared DLLs into public folders rather than isolating them in their 
own install path. For example, ssleay32.dll should not be in the "Windows" or 
"Windows32" folder, but some programs install a copy there. Postgresql properly 
installs this DLL in the bin folder, but on DLL load the copy in the Windows 
folder will load first, and cause a failure.

Original comment by ecostats...@gmail.com on 8 Oct 2010 at 12:48

GoogleCodeExporter commented 9 years ago
The preceding comment is correct -- this would appear to be a user error. You 
do need a working Postgresql installation so that the Postgresql DLLs are in 
your path. That is not something the RPostgreSQL package can do for you. Sorry.

Original comment by dirk.eddelbuettel on 15 Oct 2010 at 2:55