Wednesday 8 February 2023

PyCall in Julia to work on Windows with Anaconda

Julia ships its own Miniconda distro and uses to it by default. It actually tries to install this distro, and fails in my case. It fails to many other people too. It cannot know you already have another Python setup available. Help it with the following, when building PyCall. Note that you need to build PyCall manually before using it, or you'll get ERROR: LoadError: PyCall not properly installed. Please run Pkg.build("PyCall").

In Julia prompt, execute:

import Pkg
ENV["PYTHON"] = raw"C:\Users\YOUR_USER\anaconda3\python.exe"
Pkg.build("PyCall")

Tuesday 7 February 2023

Jupyter Lab shortcut, dir listing in a current folder

Make a regular shortcut in a directory where you want Jupyter Lab to open with this target:

C:\WINDOWS\system32\cmd.exe /K "call %HOMEDRIVE%%HOMEPATH%\Anaconda3\Scripts\activate.bat & call jupyter lab && exit"

Set "Start in" as %cd%, and "Run" as Minimized. Done!