Skip to content

Latest commit

 

History

History
72 lines (64 loc) · 3.67 KB

wsl.md

File metadata and controls

72 lines (64 loc) · 3.67 KB

WSL Editor Setup

Editing on Windows is not entirely supported due to python/sphinx issues. Instead, on Windows use WSL with VS Code.

Setup WSL and VS Code

  1. To get "Ubuntu on Windows" and other linux kernels see instructions.
  2. Install VSCode with remote WSL support on windows
  1. Clone this repository using VS Code on Windows

  2. After you open it, choose > WSL: Reopen in WSL Window from the command palette (Ctrl+Shift+P) if you have setup WSL/etc. properly

    • If you are successful, the bottom left corner of VS Code will show >< WSL:Ubuntu>
    • Now any terminals you run should be the linux ubuntu terminals
  3. Assuming you have git installed and setup properly on windows, to get git credentials integrated, in a windows terminal (i.e. not in WSL) run

    git config --global credential.helper wincred
    
    • Then in a WSL terminal (within VS Code or otherwise),
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"
    git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe"
    

Setup Linux Packages/etc.

  1. Start within your home directory in linux or in a WSL terminal

  2. In a WSL terminal, Go to your home directory and make sure key dependencies are installed

    cd ~
    sudo apt update
    sudo apt-get upgrade
    sudo apt install make gcc unzip
    sudo apt-get update
    sudo apt-get install libxt6 libxrender1 libgl1-mesa-glx libqt5widgets5 
  3. Install conda with the updated version of

wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
bash Anaconda3-2024.06-1-Linux-x86_64.sh
  • accept default paths
  • accept licensing terms
  • IMPORTANT Manually choose yes to have it do the conda init
  1. Install julia with juliaup
    curl -fsSL https://install.julialang.org | sh
  2. Install key VSCode extensions (which are a separate set of installations for WSL vs. Windows)
    • Search for python, julia, myst-markdown, Jupyter, python and if you have support GitHub Copilot, GitHub Copilot Chat
    • Usually requires restart VS Code
  3. In a terminal, create a virtual environment for conda and install packages
    conda create -n lecture-julia.myst python=3.11
    conda activate lecture-julia.myst
    pip install -r requirements.txt
  4. Can try > Python: Select Interpreter and choose the lecture-julia.myst environment to make it automatic, but it does not always work.
  5. Start a WSL terminal, make sure that the lecture-julia.myst is activated (and use conda activate lecture-julia.myst if not) then
    • Start julia, which be in your global environment with nothing installed. Can check with ]st
    • Then install the Julia jupyter kernel with ] add IJulia
  6. Install the Julia packages required for the lecture notes, running in a terminal (assuming still at the root)
    julia --project=lectures --threads auto -e 'using Pkg; Pkg.instantiate();'
    • This should take 10-15 minutes the first time.

At this point, you should be ready to follow the instructions in the main README.md