1
votes

For a future use in a jupyter context, I want to try julia through a conda installation. To do so I did the following:

conda create -n test_julia
conda activate test_julia
conda install -c conda-forge julia

From there I can start julia. However when trying, for instance, the gadfly module for doing basic test plots, I get the following error:

julia>using Pkg
julia>Pkg.add("Gadfly")
julia>using Gadfly


Error: Error building `Arpack`: 
│ [ Info: Downloading https://github.com/JuliaLinearAlgebra/ArpackBuilder/releases/download/v3.5.0-3/Arpack.v3.5.0-3.x86_64-linux-gnu-gcc7.tar.gz to /home/pellegrini/.julia/packages/Arpack/UiiMc/deps/usr/downloads/Arpack.v3.5.0-3.x86_64-linux-gnu-gcc7.tar.gz...
│ ERROR: LoadError: LibraryProduct(nothing, ["libarpack"], :libarpack, "Prefix(/home/pellegrini/.julia/packages/Arpack/UiiMc/deps/usr)") is not satisfied, cannot generate deps.jl!
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] #write_deps_file#152(::Bool, ::Function, ::String, ::Array{LibraryProduct,1}) at /home/pellegrini/.julia/packages/BinaryProvider/4F5Hq/src/Products.jl:414
│  [3] (::getfield(BinaryProvider, Symbol("#kw##write_deps_file")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(write_deps_file), ::String, ::Array{LibraryProduct,1}) at ./none:0
│  [4] top-level scope at none:0
│  [5] include at ./boot.jl:317 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1044
│  [7] include(::Module, ::String) at ./sysimg.jl:29
│  [8] include(::String) at ./client.jl:392
│  [9] top-level scope at none:0
│ in expression starting at /home/pellegrini/.julia/packages/Arpack/UiiMc/deps/build.jl:74

I read that this problem could be due to the use of a julia built from source. I suppose that it is not the case when using a conda installation. Being a bit new to conda and julia, I can't find why I have this error and how to solve it. Would you have any idea ?

2

2 Answers

1
votes

Install Julia via the Julia installer and make a link Julia=>Conda rather than Conda=>Julia. Currently all major Julia=>Conda integration issues seem to be solved and work seamlessly. This is also a standard way to work Python-Julia so this scenario will also get updates more quickly.

Since you you probably want to glue Julia to your existing Anaconda installation (rather than install a private Anaconda for your Julia which is the default option) you need to set PYTHON environment variable (this can be done in shell or with the following Julia commands):

#Windows:
julia> ENV["PYTHON"]="C:\\ProgramData\\Anaconda3\\python.exe"
#Linux
julia> ENV["PYTHON"]="~/anaconda3/bin/python"

Now you can press ] for the package manager and this is what you usually want to execute:

(v1.0) pkg> add PyCall Conda PyPlot

Now you will have integration with the external Anaconda. Looking at your question this is the best scenario.

1
votes

It sounds like it might be this known issue. Based on the discussion of this issue I fixed it on my machine by installing openblas and adding this link:

ln -s /usr/lib/libopenblas.so /usr/lib/libopenblas64_.so.0

(Note that I'm not using conda, I was using the standard Arch package.)