Getting Started: Installing Julia and VS Code
This guide will walk you through installing everything you need for this course: the Julia programming language, the VS Code editor, and two VS Code extensions for writing and running Julia code.
1 Installing Julia
The recommended way to install Julia is through the terminal using juliaup, Julia’s official version manager. See the Julia downloads page for more details.
1.1 Mac
Open a terminal (search for “Terminal” with Spotlight: ⌘ + Space).
Run the following command:
curl -fsSL https://install.julialang.org | shFollow the on-screen prompts. The installer will set up juliaup (Julia’s version manager) and install the latest stable version of Julia.
Close and reopen your terminal so the new PATH settings take effect.
Type
juliaand press Enter. The Julia promptjulia>should appear. Type1 + 1and press Enter to confirm it works.
1.2 Windows
Open PowerShell or Command Prompt (search for either in the Start menu).
Run the following command:
winget install --name Julia --id 9NJNWW8PVKMN -e -s msstoreFollow the on-screen prompts. This installs juliaup (Julia’s version manager) and the latest stable version of Julia, and adds it to your PATH automatically.
Close and reopen your terminal so the new PATH settings take effect.
Type
juliaand press Enter. The Julia promptjulia>should appear. Type1 + 1and press Enter to confirm it works.
2 Installing VS Code
2.1 Mac
- Go to https://code.visualstudio.com/.
- Click the large Download for macOS button.
- Open the downloaded
.dmgfile. - Drag Visual Studio Code into your Applications folder.
- Open VS Code from your Applications folder.
2.2 Windows
- Go to https://code.visualstudio.com/.
- Click the large Download for Windows button.
- Run the downloaded installer.
- Accept the license agreement and click through the installer. On the Select Additional Tasks screen, I recommend checking:
- Add “Open with Code” action to Windows Explorer file context menu
- Add to PATH (should be checked by default)
- Click Install and then Finish.
- VS Code should open automatically. If not, search for “Visual Studio Code” in the Start menu.
3 Installing the Julia Extension in VS Code
This extension gives you syntax highlighting, code completion, and the ability to run Julia code directly inside VS Code.
- Open VS Code.
- Click the Extensions icon in the left sidebar (it looks like four small squares, or press
Ctrl+Shift+Xon Windows /⌘+Shift+Xon Mac). - In the search bar at the top, type Julia.
- Find the extension called Julia by julialang (it should be the first result).
- Click Install.
- After installation, VS Code may prompt you to set the Julia executable path. If Julia was added to your PATH (see installation steps above), VS Code should detect it automatically. If not:
- Open VS Code settings (
Ctrl+,on Windows /⌘+,on Mac). - Search for
Julia: Executable Path. - Set it to the path where Julia is installed:
- Mac:
/Applications/Julia-1.12.app/Contents/Resources/julia/bin/julia(adjust the version number if needed) - Windows:
C:\Users\YourUsername\AppData\Local\Programs\Julia-1.12.0\bin\julia.exe(adjust the version number and username)
- Mac:
- Open VS Code settings (
- After you restart VS Code, you can open the Julia REPL by pressing
Alt+JthenAlt+O. (Option J + Option O on Mac). It may ask you to install Revise.jl. Click install to install it.
3.1 Testing the Julia Extension
Create a new file in VS Code (
Ctrl+N/⌘+N) and save it astest.jl. (.jl is the file extension for Julia files. That way the Julia extension knows to highlight the file as Julia code.)Type the following:
println("Hello, EC 410!")Press
Ctrl+Enterto run the line. The Julia REPL should open at the bottom of VS Code and printHello, EC 410!.
4 Installing the Jupyter Notebook Extension in VS Code
This extension allows you to create and run Jupyter notebooks (.ipynb files) directly in VS Code. We will use notebooks for completing and submitting problem sets.
- Open VS Code.
- Click the Extensions icon in the left sidebar (
Ctrl+Shift+X/⌘+Shift+X). - In the search bar, type Jupyter.
- Find the extension called Jupyter by Microsoft (it should be the first result).
- Click Install. This will also install several related extensions (Jupyter Keymap, Jupyter Cell Tags, etc.) automatically.
5 Getting the Course Notebooks
5.1 Installing Git
Git is a version control tool we will use to download the course notebooks.
5.1.1 Mac
- Open a terminal (search for “Terminal” with Spotlight: ⌘ + Space).
- Type
git --versionand press Enter. If Git is already installed, you will see a version number and can skip to the next section. - If Git is not installed, macOS will prompt you to install the Xcode Command Line Tools — click Install and follow the prompts. This may take a few minutes.
5.1.2 Windows
- Go to https://git-scm.com/download/win.
- The download should start automatically. Run the installer.
- Click through the installer with the default settings.
- Once installed, open Git Bash from the Start menu to confirm it works: type
git --versionand press Enter.
5.2 Downloading the Course Notebooks
With Git installed, you can now download the course notebook repository.
Open a terminal (Mac) or Git Bash (Windows).
Navigate to the folder where you want to store course files. For example, to put them on your Desktop:
- Mac:
cd ~/Desktop - Windows:
cd ~/Desktop
- Mac:
Run the following command to clone the repository:
git clone https://github.com/dgevans/UndergraduateComputationalNotebooksThis will create a folder called
UndergraduateComputationalNotebookscontaining all the course notebooks.
5.3 Setting Up the Julia Environment
The notebook repository includes a Project.toml file that lists all the Julia packages used in this course. You need to activate this environment and install the packages once before running any notebooks.
Open VS Code and open the
UndergraduateComputationalNotebooksfolder (File→Open Folder).In the bottom toolbar, click Julia env: and select the
UndergraduateComputationalNotebooksenvironment from the list.Open the Julia REPL by pressing
Alt+JthenAlt+O. A Julia terminal will appear at the bottom of VS Code.Press
]to enter package mode. The prompt will change to(UndergraduateComputationalNotebooks) pkg>.Type the following and press Enter:
instantiateJulia will download and install all required packages. This may take several minutes the first time. Press Backspace when it finishes to return to the normal Julia prompt.
After this one-time setup, the environment will be ready whenever you open a notebook from this folder.
6 Summary
You should now have the following installed and working:
| Software | Purpose |
|---|---|
| Julia | The programming language we use in this course |
| VS Code | The code editor where you will write and run Julia code |
| Julia extension | Lets you run .jl files and provides syntax highlighting in VS Code |
| Jupyter extension | Lets you create and run .ipynb notebooks in VS Code for problem sets |
| Git | Downloads the course notebook repository |
| Course notebooks | The .ipynb files you will use for lectures and problem sets |
If you run into any issues, don’t hesitate to come to office hours or email me at devans@uoregon.edu.