Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Julia Environment Installation

Julia Environment Setup

The Julia language supports the following systems:

Julia officially recommends using Juliaup installation via a version manager, which automatically manages multiple Julia versions and keeps them up to date.

The Julia installer download address is:https://julialang.org/downloads/.

Github source code address:https://github.com/JuliaLang/julia.

Domestic mirror address:https://mirrors.tuna.tsinghua.edu.cn/julia-releases/bin/

Package names corresponding to each system (taking Julia 1.10.4 as an example):

Operating system Package name
Windows julia-1.10.4-win64.exe
Linux julia-1.10.4-linux-x86_64.tar.gz
Mac (Intel) julia-1.10.4-mac64.tar.gz or .dmg
Mac (Apple Silicon) julia-1.10.4-macaarch64.tar.gz or .dmg
FreeBSD julia-1.10.4-freebsd-x86_64.tar.gz

Note:Whether the CPU is X86 or ARM can be checked with uname -m command; the output x86_64 indicates the X86 architecture, and the output arm64 or aarch64 indicates the ARM architecture:

$ uname -m

x86_64


Install with Juliaup (recommended)

Windows Installation

The simplest way on Windows is to install Julia from the Microsoft Store, or install it with the winget command:

winget install --name Julia --id 9NJNWW8PVKMN -e -s msstore

Installation on Linux and macOS

On Linux or macOS, run the following command to install Juliaup and the latest stable Julia:

curl -fsSL https://install.julialang.org | sh

After installation, reopen the terminal and the julia command will be available.

Common installer options:

Parameters Description
--yes Install in non-interactive mode, using all default configurations
--default-channel=lts Install the long-term support (LTS) version and set it as default
--add-to-path=no Do not add Julia to the PATH environment variable

After installation you can use the juliaup command to manage versions:

$ juliaup status          # 查看当前使用的版本

$ juliaup add 1.10        # 安装 1.10 版本

$ juliaup default 1.10    # 设置默认版本


Install using binary packages

If you do not use Juliaup, you can also download a binary package directly to install.

Installation on Windows

From the https://julialang.org/downloads/ Download the Windows Julia installer.

Note:32-bit Julia binaries can run on both 32-bit and 64-bit Windows, but 64-bit Julia binaries can only run on 64-bit Windows (x86_64); nowadays virtually all computers are 64-bit.

Run the installer and just click Next during the installation.

Check Add Julia To PATH to automatically add Julia to the environment variables.

This way we can execute the julia command in the terminal.

The default Julia installation directory is similar to C:\Users\RUNOOB\AppData\Local\Programs\Julia 1.10.4.

Installation on Linux/FreeBSD

Download the x86_64 binary package:

wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.4-linux-x86_64.tar.gz

The above are the download addresses provided on the official site; if the speed is slow, you can download from a domestic mirror address (note that the path contains an x64 directory):

wget https://mirrors.tuna.tsinghua.edu.cn/julia-releases/bin/linux/x64/1.10/julia-1.10.4-linux-x86_64.tar.gz

Extract:

tar zxvf julia-1.10.4-linux-x86_64.tar.gz

Linux/FreeBSD binaries do not need installation, but our system needs to be able to find the julia executable, which requires adding the julia directory to the system environment.

After extraction, move the extracted julia directory to the /usr/local directory:

sudo mv julia-1.10.4 /usr/local/

After moving, we can execute the julia command using the full directory:

$ /usr/local/julia-1.10.4/bin/julia -v

julia version 1.10.4

The julia -v command is used to view the version number.

You can also add the julia command to your system PATH environment variable by editing ~/.bashrc(or ~/.bash_profile) file, adding the following code on the last line:

export PATH="$PATH:/usr/local/julia-1.10.4/bin/"

After adding, run the following command to make the environment variables take effect immediately:

source ~/.bashrc

或

source ~/.bash_profile

This way we can execute the julia command directly without adding the full path:

$ julia -v

julia version 1.10.4

macOS Installation

For Apple Silicon (M1/M2/M3, etc.) chips download the macaarch64 package, and for Intel chips download the mac64 package:

# Apple Silicon 版本

wget https://julialang-s3.julialang.org/bin/mac/aarch64/1.10/julia-1.10.4-macaarch64.tar.gz



# Intel version

wget https://julialang-s3.julialang.org/bin/mac/x64/1.10/julia-1.10.4-mac64.tar.gz

Extract:

tar zxvf julia-1.10.4-macaarch64.tar.gz

Move the extracted directory to the /usr/local directory:

sudo mv julia-1.10.4 /usr/local/

To add julia to the PATH environment variable, edit ~/.zshrc(the default shell on macOS is zsh) file, adding on the last line:

export PATH="$PATH:/usr/local/julia-1.10.4/bin/"

After adding, run the following command to make the environment variables take effect immediately:

source ~/.zshrc

Verify installation:

$ julia -v

julia version 1.10.4

You can also install using Homebrew:

brew install julia


Verify the installation

After installation, run the julia command to enter the interactive window, and run versioninfo() to view detailed version information:

Example

julia

versioninfo

(

)

Julia Version 1.10.4

Commit 48d4fd48430

(

2024

-03-

25

16

:

10

UTC

)

Build Info:

  Official https://julialang.

org

/ release

Platform Info:

  OS: macOS

(

arm64-apple-darwin22.4.0

)

  CPU:

8

× Apple M1

  WORD_SIZE:

64

  LIBM: libopenlibm

  LLVM: libLLVM-15.0.7

(

ORCJIT, apple-m1

)