Skip to content

Instantly share code, notes, and snippets.

@pmudry
Last active December 15, 2021 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmudry/877837899a90dc4f21f2cd4b90945510 to your computer and use it in GitHub Desktop.
Save pmudry/877837899a90dc4f21f2cd4b90945510 to your computer and use it in GitHub Desktop.
Python jupyter on WSL

How to install Jupyter-nb environment in WSL on Windows, no preriquistes

  1. Install miniconda from (https://docs.conda.io/en/latest/miniconda.html)
  2. Install mamba with conda install mamba -n base -c conda-forge
  3. Install the forge with mamba install xtensor-r -c conda-forge
  4. Install Jupyter NB with mamba install -c conda-forge jupyterlab
  5. Install some packages mamba install -c conda-forge pandas matplotlib seaborn numpy
  6. Run with jupyter-lab or in VSCode

Installing opencv for vscode with intellisense

mamba install -c conda-forge opencv

However, because opencv comes as a compiled modules, we need the correct stub until MS has it working, so do that :

curl -sSL https://raw.githubusercontent.com/bschnurr/python-type-stubs/add-opencv/cv2/__init__.pyi >> cv2.pyi

Then copy the file to path reported by the following code :

import cv2 as cv2
import os

print(os.path.dirname(cv2.__file__))

Relaunch the Jupyter interpreter and voilà, Intellisense working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment