JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.47k stars 187 forks source link

Help wanted : link pycall to anaconda env with .yml file #907

Closed agatheLG123 closed 3 years ago

agatheLG123 commented 3 years ago

Hi, I want to call a python function in my julia code which uses various libraries. The anaconda environement used for my python code to work is defined wuth a .yml file. Right now I build a docker container from a julia image FROM julia:latest which install dependencies from a manifest and project files as such in my dockerfile : RUN julia -e "using Pkg; Pkg.activate(\".\"); Pkg.instantiate(); Pkg.precompile(); " In those package Pycall is installed.

I tried running afterwards in my dockerfile

RUN conda env create -f environment.yml
RUN conda env list
RUN conda activate ApplicationMarfan

However this is not working... I saw on pycall doc that there was an ENV[PYTHON] that could be defined however it's a .exe and what I have is a .yml Does anyone have an idea on how to install dependencies used in the python code called from the julia code with pycall package, via a .yml file ? Thanks in advance.

stevengj commented 3 years ago

Once you've set up and activated your conda environment, you should be able to tell PyCall to use that Python installation by setting ENV["PYTHON"] to the path of that python executable.