Julia fails to precompile packages ExcelFiles, Plots and JuMP - julia

I am a beginner with using Julia and I am trying to use the packages. However, when I try to use the packagegs Excelfiles, plots and JuMP. I use this code for the packages:
Pkg.add("JuMP")
using JuMP
I get the error: ERROR: Failed to precompile JuMP [4076af6c-e467-56ae-b986-b466b2749572] to C:\Users\yobbi.julia\compiled\v1.7\JuMP\jl_39BC.tmp. I already updated the packages, restarted my laptop, and downloaded Julia again but I keep getting this error. Can someone help me out? Thanks!

Try:
using Pkg
pkg"build JuMP"
This will either resolve your problem or show you errors in the package build process.
Please also note that "reinstalling" Julia usually not helps as Julia is keeping its files in the .julia folder.
Finally, your folder C:\Users\yobbi.julia looks fishy to me. Maybe it is a typo and it should be C:\Users\yobbi\.julia or you managed to misconfigure something with the JULIA_DEPOT_PATH variable.

Related

Reticulate package, cannot install Python packages using py_install()

I am following the instructions here to install packages (I'm looking at the "Simple Installation") section: https://rstudio.github.io/reticulate/articles/python_packages.html
Here is my R code:
library(reticulate)
use_python(python="C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python39\\python.exe")
py_install("pandas")
However, I'm getting the following error:
Error: could not find a Python environment for
C:/Users/.../AppData/Local/Programs/Python/Python39/python.exe
How do I resolve this? I have used py_install() this way on another computer before, so I know it's possible and I would like to use it. However, I can't understand what I'm missing.
You might respond that I need to specify an environment when using py_install(), but the instructions in the link don't require that, and I know it can be done without specifying an environment every time. Do I need to somehow set a "default"?
EDIT: Just to clarify, I am on Windows.
You may not be connected to the proper environment. Depending on your OS, you will likely have to create a .Renviron file and direct R to look for it.
This post here, should help you diagnose the issue:
Unable to change Python path in reticulate

Installing Julia on Atom

I am trying to install Julia on Atom. What I made already is that I installed Julia in this folder :
E:\Program files\Users\Zeedo\AppData\Local\Julia-0.6.3
and I installed Atom. Then, I also installed language-Julia package.
Now, when I want to run a code, I get this error:
Julia could not be started.
We tried to launch Julia from:
julia
This path can be changed in the settings.
Details:
'"julia"' is not recognized as an internal or external command,
operable program or batch file.
So, I don't know where should I give the Julia address to the Atom.Or, if you know something that I am doing wrong, please let me know.
Thanks :)
Atom cannot run code by default, so that error message must be being thrown by a community package you've installed. Searching shows me the package is most likely atom-julia-client. And the error seems to be because it can't find the Julia binary it needs to run the program.
First, you should make sure you can run the julia command from the command line directly, which you can check by running julia --version. If this doesn't work, then you need to add the Julia binary to your path.
If the above didn't work, try go to Settings -> Packages -> julia-client. In here, the first setting is Julia Path, which is defaulted to julia (like in the error). Change this to an absolute path, directly to the binary (or to the folder containing the binary; try both if the first doesn't work).
FYI, the language-julia package just gives you syntax highlighting and snippets, and doesn't actually need any Julia stuff to work.

Origin of source code caching when writing an R package

Even though I duly setwd() (within an R session running in an Emacs/ESS buffer) to the root of my R package and run devtools::load_all() there, when I call a function I find that I am running a version of the function that no longer exists in the present R package. Running rm(<function_name>), followed by source-ing the relevant file, do not help.
Might I perhaps be running a version of the package that I inadvertently installed?, I ask myself. I run lapply(.libPaths(), dir) to answer, but my package does not appear.
What is happening? Where/how is this caching happening?
Update
Running
rm(list=ls())
as described here solved the problem. Although it's not clear what the problem might have been in the first place. An explanation is very welcome.
R caches your global environment in a file .Rdata. Delete it and start a new session.

XRJulia and findJulia

I am trying to get XRJulia to run, and the first task is to get R to recognise Julia. I followed the answer on this question, which did not solve my problem.
This what I did: After installing Julia I went to the systems variable menu and I added the the bin location of the installation directory, something like “D:\ProgramFiles\Julia-0.6.1\bin” to the path system variable. Note that I am able to start Julia from the command prompt after doing that.
And this is the result:
library(XRJulia)
findJulia(test = TRUE)
[1] FALSE
So, the question is, what am I missing?
I am using R 3.4.2, Julia 0.6.1, and windows 10.
I had similar issue and this is how I found out the issue and fixed it.
First:
library(JuliaCall)
julia_setup()
and no surprise it failed.
Added key Julia_HOME and correct Julia bin path in windows environment setting. Tried again.
Loading setup script for JuliaCall...
However, after a several minutes:
ERROR: LoadError: RCall not properly installed. Please run Pkg.build("RCall")
So opened Julia and rebuilt RCall.
Tried again and it worked fine.
Tried:
library(XRJulia) findJulia(test = T)
and it all worked out.

Infinite loop caused by require(gWidgetstcltk)

When I require(gWidgetstcktk), I get an infinite loop, with a seemingly endless number of error messages that look like this:
error reading package index file /Library/Frameworks/R.framework/Versions/2.14/Resources/library/tcltk2/tklibs/ttktheme_clearlooks/pkgIndex.tcl: can't find package tile
error reading package index file /Library/Frameworks/R.framework/Versions/2.14/Resources/library/tcltk2/tklibs/ttktheme_clearlooks/pkgIndex.tcl: too many nested evaluations (infinite loop?)
(On each iteration the path is different. The end of these messages seem to be the important parts: can't find package tile and too many nested evaluations (infinite loop?)
I installed the packages as usual using install.package() and the files referred to seem to be present. gWidgets seems to load just fine. I'm running R 2.14.1 via RStudio 0.96.231 on OSX 10.7.4. What is going wrong here?
Update: I now see that the problem is coming from the tcltk2 package.
That shouldn't happen. First off, I'd say try uninstalling the package and then re-installing it. There might have been an error during the process. Another thing you should do is select "Install All Dependencies" when you do this (or install.packages(______, dependencies = TRUE)). Have you installed all of the package's relevant dependencies? Perhaps this library requires a different library which you don't have.

Resources