[R] Still have problems with tcltk in R 64 bit

Arnaud Mosnier a.mosnier at gmail.com
Wed Jun 15 16:24:42 CEST 2011


I was pretty sure to have installed tcltk files for 64 bit from the
installer, but to be sure ...
- I removed previously created Environment variables (MY_TCLTK)
- I reinstalled R one more time ...  this time with the "full
installation" option

and ... it does not work (still works with R 32bit) !

- I also tried to define directly the path to the tcl version included
with R ... as the code you provided does ... thus MY_TCLTK =
C:\Program Files\R\R-2.13.0\Tcl\bin64

... still the same error in R 64 bit, and if I want to load tcltk in R
32, it gives me the following error (normal ... it tried to load a 64
bit application in a 32 bit environment).

Loading Tcl/Tk interface ...Error : .onLoad failed in loadNamespace()
for 'tcltk', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/Program
Files/R/R-2.13.0/library/tcltk/libs/i386/tcltk.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.

Error: package/namespace load failed for 'tcltk'

I believe that the problem may come from the tcltk.dll file but I do
not understand how it can be broken each time when I installed other
versions ...

Arnaud


2011/6/15 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
> Well, the R code in package tcltk for startup under Windows is, as you could
> have found out yourself easily:
>
> .onLoad <- function(lib, pkg)
> {
>    packageStartupMessage("Loading Tcl/Tk interface ...",
>                          domain = "R-tcltk", appendLF = FALSE)
>    if(!nzchar(tclbin <- Sys.getenv("MY_TCLTK"))) {
>        tclbin <- file.path(R.home(), "Tcl",
>                            if(.Machine$sizeof.pointer == 8) "bin64" else
> "bin")
>        if(!file.exists(tclbin))
>            stop("Tcl/Tk support files were not installed", call.=FALSE)
>        if(.Machine$sizeof.pointer == 8) {
>            lib64 <- gsub("\\", "/", file.path(R.home(), "Tcl", "lib64"),
>                          fixed=TRUE)
>            Sys.setenv(TCLLIBPATH = lib64)
>        }
>    }
>    library.dynam("tcltk", pkg, lib, DLLpath = tclbin)
>    .C("tcltk_start", PACKAGE="tcltk")
>    addTclPath(system.file("exec", package = "tcltk"))
>    packageStartupMessage(" ", "done", domain = "R-tcltk")
>    invisible()
> }
>
>
> This tells us that if you do not have "MY_TCLTK" defined on startup of R,
> you probably forgot to select the tcltk files for 64 bit from the installer
> when installing your version of R.
>
> Uwe Ligges
>
>
>
>
> On 15.06.2011 14:28, Arnaud Mosnier wrote:
>>
>> I agree that this is a really outdated source but I did not find the
>> way to tell R using correctly the tcl version included (at least for
>> the 64 bit version).
>> If I remove the environment variables, things work for R 32 bit (it
>> uses the tcl version included), but it does not work in R 64 bit.
>>
>> Where are the configuration files used to define the path to each tcl
>> version ?
>>
>> Arnaud
>>
>> 2011/6/14 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
>>>
>>>
>>> On 14.06.2011 22:01, Arnaud Mosnier wrote:
>>>>
>>>> I achieve to make tcltk work on R 64 installing Active tcltk8.5 64bit
>>>> version then setting windows environment variables as in
>>>> http://www.sciviews.org/_rgui/tcltk/InstallRTclTk.html.
>>>
>>> Don't read outdated sources but the manuals.
>>>
>>> The R binary distribution comes with tcltk under Windows (in
>>> ${R_HOME}/tcl)
>>> for both 32-bit and 64-bit and will user a different tcl if you set
>>> environment variables.
>>>
>>> Hence the easiest thing is just to tell R not to use your otehrwise set
>>> environment variabes and use its own tcl version.
>>>
>>> Uwe Ligges
>>>
>>>
>>>
>>>> But now, it uses only this 64 bit version and thus do not work anymore
>>>> in R 32 bit !
>>>>
>>>> In my case, it solves my problem as I will probably use only R 64bit
>>>> but I do not like to end with an half solution.
>>>>
>>>> Arnaud
>>>>
>>>> 2011/6/14 Peter Langfelder<peter.langfelder at gmail.com>:
>>>>>
>>>>> On Tue, Jun 14, 2011 at 12:47 PM, Adrienne Wootten<amwootte at ncsu.edu>
>>>>>  wrote:
>>>>>>
>>>>>> Taking a quick look for it, it seems that they have replaced it with
>>>>>> tcltk2.  I just did the installation with the same version in windows
>>>>>> and it auto loaded the tcltk package and I never installed that
>>>>>> package to begin with.  I would try it with tcltk2 and see if you get
>>>>>> the package to install appropriately.  I'm not sure why tcltk isn't on
>>>>>> CRAN anymore, it makes no sense not to have both tcltk and tcltk2, but
>>>>>> here's hoping this helps you out.
>>>>>>
>>>>>> A
>>>>>
>>>>> FWIF, tcltk still exists but is now part of the standard R
>>>>> distribution ("core packages" is the term I think?) and as such is
>>>>> installed automatically when you install R. Therefore it is not
>>>>> available from CRAN.
>>>>>
>>>>> Peter
>>>>>
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list