How to use ANACONDA's Python from Julia


I am using Pycall to call Python from Julia. From Julia Prompt I used Pkg.add(“PyCall”). During its installation its downloading miniconda for Python.
I have anaconda in my PC and want to use Anaconda’s Python. Is their any way?


From the package README file:

If you want to use a different version of Python than the default [miniconda], you can change the Python version by setting the PYTHON environment variable to the path of the python executable and then re-running“PyCall”). In Julia:

ENV[“PYTHON”] = "… path of the python program you want …"“PyCall”)


Is Anaconda’s Python on the path? If so, it should not download a new Python installation.

As pointed out by @dpsanders in the post below, this is the default only for Linux. Julia on Windows and Mac downloads a minimal private Python installation.


That changes as of IJulia 1.4 (if I remember correctly). The default is now always to download a new conda installation, to try to ensure the correct versions of everything.


How can you do it on Windows?


The same thing should work, or run set PYTHON=c:\path\to\python in a prompt before starting julia.