This setup is imho more flexible and better reproducable than using the default Conda env from Julia.
As I understand it you are suggesting using global Conda (not Conda that comes with Julia) to manage environments and Python packages which as I understand is different than mostly recommended use of Conda that comes with Julia. As I understand it your suggestions might also provide a way to execute the code directly from VS Code with the use of i.e. Alt+Enter
as well as provide access to Julia versions that are not present at conda / conda-forge.
Based on this understanding I tried to implement your suggestion. I created new Conda environment “julia18” [“conda create --name julia18
”] which is located at /home/xxxxxx/.conda/envs/julia18
. I installed Julia from julia-latest-linux64.tar.gz
official binaries. I tried two options in julia to set ENV['PYTHON']
: one was ENV["PYTHON"]=""
and the second ENV["PYTHON"]="/home/xxxxxx/.conda/envs/julia18/bin/python"
and in both cases I added PyCall v1.92.3 [Updating `~/.julia/environments/v1.8/Project.toml.
When:
julia> using PyCall
[ Info: Precompiling PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0]
ERROR: LoadError: IOError: open("/glob/development-tools/versions/[...]python/latest/condarc-julia.yml", 577, 33261): read-only file system (EROFS)
in expression starting at /home/xxxxxx/.julia/packages/Conda/sNGum/src/Conda.jl:1
ERROR: LoadError: Failed to precompile Conda [8f4d0f93-b110-5947-807f-2305c1781a2d] to /home/xxxxxx/.julia/compiled/v1.8/Conda/jl_2w0VUw.
in expression starting at /home/xxxxxx/.julia/packages/PyCall/BD546/src/PyCall.jl:1
ERROR: Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] to /home/xxxxxx/.julia/compiled/v1.8/PyCall/jl_WmUWT5.
I encountered errors as above. As I informed in my previous post my base environment is “read only”. I think it is a similar situation to descibed here: https://github.com/JuliaPy/Conda.jl/issues/166. It was more than a few months ago when I was setting up my environment, however, if I am recalling correctly this was one of the reasons that I decided to install Julia through conda in a separate conda environment. I took a look at my notes and I think those might be the steps I followed:
# Create julia env with python=3.8.5
conda create --name julia python=3.8.5
# OPTIONAL: Add conda-forge channel
conda config --add channels conda-forge
# Install Julia 1.6.0
conda install -c mjohnson541 julia
# Start julia and
julia> ENV["PYTHON"]=""
(@v1.6) pkg> add PyCall
(@v1.6) pkg> add Conda
julia> using Conda
julia> Conda.add("choosen conda package name")
or
use global Conda to add packages to Conda environment.
Should you have any comments or suggestions I would be happy to try them. Thank you once again.