Anaconda Python + Spyder on Windows Subsystem for Linux

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 Spyder IDE in 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

Notes

You may be missing X11 prereqs, which will be 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.

Matplotlib trouble

Notes on setting up Matplotlib for WSL

systems without MKL

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