Anaconda Python + Spyder on WSL

Python can be used within Windows Subsystem for Linux. Using Python on WSL can be advantageous because of easier compiler access. We generally use Miniconda Python on WSL.

Setup X11 for WSL and then install Spyder:

conda install matplotlib spyder

If Spyder won’t start, ensure X11 is working with another program. Look in the error message for missing libraries such as libxcomposite libxss1 X11 prereqs are specified in the error message on starting GUI programs like Spyder. Look above the error:

ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

to see if things like libxcomposite or libxss etc. need to be installed via apt install.

Notes on setting up Matplotlib for WSL

Systems incompatible with Intel MKL may get errors using modules like Scipy or Numpy:

import scipy; scipy.test()
OMP: Error #100: Fatal system error detected.
OMP: System error #22: Invalid argument

Workaround: install MKL-less versions of these packages by

conda install nomkl