Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
*.pyc
*.un~
/build/
/deps/deps.jl
/deps/build.log
/deps/JUPYTER
/deps/julia-*
*.jl.*.cov
Manifest*.toml
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
ZMQ = "c2297ded-f4af-51ae-bb23-16f91089e4e1"
Expand Down Expand Up @@ -42,6 +43,7 @@ REPL = "1"
Random = "1"
Revise = "3"
SHA = "0.7, 1"
Scratch = "1.3.0"
Sockets = "1"
UUIDs = "1"
ZMQ = "1.4"
Expand Down
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align="center"><img src="deps/ijulialogo.png" alt="IJulia logo" width="150"/></div>
<div align="center"><img src="assets/ijulialogo.png" alt="IJulia logo" width="150"/></div>

[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaLang.github.io/IJulia.jl/stable)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaLang.github.io/IJulia.jl/dev)
Expand Down Expand Up @@ -31,29 +31,26 @@ Install IJulia from the Julia REPL by pressing `]` to enter pkg mode and enterin
add IJulia
```

If you already have Python/Jupyter installed on your machine, this process will also install a
[kernel specification](https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernelspecs)
that tells Jupyter how to launch Julia. You can then launch the notebook server the usual
way by running `jupyter notebook` in the terminal.

Note that `IJulia` should generally be installed in Julia's global package environment, unless you
install a custom kernel that specifies a particular environment.

Alternatively, you can have IJulia create and manage its own Python/Jupyter installation.
To do this, type the following in Julia, at the `julia>` prompt:
To launch the Jupyter notebook, type the following in Julia at the `julia>` prompt:

```julia
using IJulia
notebook()
```

to launch the IJulia notebook in your browser.
The first time you run `notebook()`, it will prompt you
for whether it should install Jupyter. Hit enter to
have it use the [Conda.jl](https://github.com/Luthaf/Conda.jl)
package to install a minimal Python+Jupyter distribution (via
[Miniconda](https://www.anaconda.com/docs/getting-started/miniconda/install#quickstart-install-instructions)) that is
private to Julia (not in your `PATH`).
The first time you run `notebook()`, it will:
- Prompt you to install Jupyter if you don't already have it (hit enter to
install via [Conda.jl](https://github.com/JuliaPy/Conda.jl), which creates a
minimal Python+Jupyter distribution private to Julia).
- Automatically install the Julia kernel for your current Julia version.

If you already have Jupyter installed and prefer to use it, you can launch it
from the terminal with `jupyter notebook` instead. A Julia kernel can be
installed with `IJulia.installkernel()`.

**Note:** IJulia should generally be installed in Julia's global package
environment, unless you install a custom kernel that specifies a particular
environment.

For more advanced installation options, such as specifying a specific Jupyter
installation to use, see the [documentation](https://JuliaLang.github.io/IJulia.jl/stable).
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
45 changes: 0 additions & 45 deletions deps/build.jl

This file was deleted.

28 changes: 28 additions & 0 deletions docs/src/_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@ CurrentModule = IJulia
This documents notable changes in IJulia.jl. The format is based on [Keep a
Changelog](https://keepachangelog.com).

## Unreleased

### Added
- Added [`IJulia.update_jupyter_path()`](@ref) function to explicitly update the saved
Jupyter executable path preference.
- Added a zero-argument [`installkernel()`](@ref) convenience method that installs
the default Julia kernel with `--project=@.`.

### Changed
- Removed `Pkg.build("IJulia")` support. IJulia no longer uses a
build step for kernel installation. The build-time configuration system has
been replaced with runtime functions. Use [`installkernel()`](@ref) to install
or update kernels, and [`update_jupyter_path()`](@ref) to configure the
Jupyter executable path.
- IJulia now uses [Scratch.jl](https://github.com/JuliaPackaging/Scratch.jl) to
store configuration preferences instead of instead of writing to
`DEPOT_PATH/prefs/`.
- Kernel auto-installation (when calling `notebook()` or `jupyterlab()`) now
checks if the **default** kernel for the current Julia version exists.
If not, it automatically installs it. This auto-installation can be disabled
by setting the `IJULIA_NODEFAULTKERNEL` environment variable. Note that
explicit calls to `installkernel()` always install/update a kernel for the
current Julia version, regardless of the environment variable.
- `ENV["IJULIA_DEBUG"]` now automatically enables verbose output for `notebook()` and
`jupyterlab()`, making it easier to debug Jupyter launch issues.

## [v1.33.0] - 2025-11-22

### Added
Expand Down Expand Up @@ -53,6 +79,8 @@ Changelog](https://keepachangelog.com).
patch release of Julia, but it does mean that IJulia will only create kernels
for each Julia minor release instead of each patch release.



### Fixed
- Fixed the display of `UnionAll` types such as `Pair.body` ([#1203]).
- Fixed a bug in the [PythonCall extension](manual/usage.md#Python-integration)
Expand Down
1 change: 1 addition & 0 deletions docs/src/library/public.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
IJulia.IJulia
IJulia.inited
IJulia.installkernel
IJulia.update_jupyter_path
```


Expand Down
83 changes: 46 additions & 37 deletions docs/src/manual/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
```

!!! info
This process installs a
[kernel specification](https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernelspecs)
for IJulia. The IJulia kernelspec, shorthand for kernel specification,
contains the instructions for launching a Julia kernel that a notebook
frontend (Jupyter, JupyterLab, nteract) can use. The kernelspec does not
install the notebook frontend.
The Julia kernel will be automatically installed the first time you run
[`IJulia.notebook()`](@ref) or [`IJulia.jupyterlab()`](@ref), or you can
install it manually by running [`IJulia.installkernel()`](@ref). The kernel
specification contains the instructions for launching a Julia kernel that a
notebook frontend (Jupyter, JupyterLab, nteract) can use.

IJulia respects the standard
[`JUPYTER_DATA_DIR`](https://docs.jupyter.org/en/stable/use/jupyter-directories.html#data-files)
environment variable, so you can set that before installation if you want
the kernel to be installed in a specific location.
environment variable, so you can set that before installing the kernel if you want
it to be installed in a specific location.

!!! warning
The command, `Pkg.add("IJulia")`, does not install Jupyter
Expand All @@ -34,19 +33,26 @@
You can install Jupyter Notebook by following the Notebook's
installation instructions if you want. Conveniently, Jupyter
Notebook can also be installed automatically when you run
`IJulia.notebook()`.
`IJulia.notebook()`.
See [Running the Julia notebook](running.md#Running-the-IJulia-Notebook).

You can direct `IJulia.notebook()` to use a specific Jupyter
installation by setting `ENV["JUPYTER"]` to the path of the
`jupyter` program executable. This environment variable should
be set before `Pkg.add` or before running `Pkg.build("IJulia")`,
and it will remember your preference for subsequent updates.
installation by passing the path directly to `IJulia.update_jupyter_path()`,
or by setting `ENV["JUPYTER"]` before calling it. This preference will be
remembered for subsequent updates. For example:
```julia
# Option 1: Pass path directly
IJulia.update_jupyter_path("/usr/local/bin/jupyter")

# Option 2: Set environment variable
ENV["JUPYTER"] = "/usr/local/bin/jupyter"
IJulia.update_jupyter_path()
```

## Updating Julia and IJulia

Julia is improving rapidly, so it won't be long before you want to
update your packages or Julia to a more recent version.
update your packages or Julia to a more recent version.

### Update packages

Expand All @@ -66,7 +72,8 @@ for the most recent Julia). If you're using juliaup to manage Julia, then for
every Julia *minor release* (1.11, 1.12, etc) you will need to explicitly update
the IJulia installation to tell Jupyter where to find the new Julia version:
```julia
Pkg.build("IJulia")
using IJulia
IJulia.installkernel()
```

This is because IJulia creates default kernels for every minor version if it
Expand All @@ -77,17 +84,13 @@ installation every time you install a new Julia binary (or do anything that
*changes the location of Julia* on your computer).


!!! important
`Pkg.build("IJulia")` **must** be run at the Julia command line.
It will error and fail if run within IJulia.

## Installing and customizing kernels

You may find it helpful to run multiple Julia kernels to support different Julia
executable versions and/or environment settings.

You can install one or more custom Julia kernels by using the
[`IJulia.installkernel`](@ref) function. For example, if you want to run Julia
[`IJulia.installkernel()`](@ref) function. For example, if you want to run Julia
with all deprecation warnings disabled, you can create a custom IJulia kernel:

```julia
Expand All @@ -99,7 +102,7 @@ will be installed (will show up in your main Jupyter kernel menu) that
lets you open notebooks with this flag. Note that the default kernel
that IJulia installs passes the `--project=@.` option to Julia, if you
want to preserve this behaviour for custom kernels make sure to pass it
explicitly to `IJulia.installkernel`:
explicitly to [`IJulia.installkernel`](@ref):
```julia
installkernel("Julia nodeps", "--depwarn=no", "--project=@.")
```
Expand All @@ -116,23 +119,27 @@ installkernel("Julia (4 threads)", env=Dict("JULIA_NUM_THREADS"=>"4"))

The `env` keyword should be a `Dict` which maps environment variables to values.

To *prevent* IJulia from installing a default kernel when the package is built,
define the `IJULIA_NODEFAULTKERNEL` environment variable before adding or
building IJulia.
If you want to disable automatic installation of the default kernel (for example, if
you only want custom kernels), set the `IJULIA_NODEFAULTKERNEL` environment variable:

## Low-level IPython Installations
```julia
using IJulia

We recommend using IPython 7.15 or later as well as Python 3.
# Disable auto-installation of the default kernel
ENV["IJULIA_NODEFAULTKERNEL"] = "true"

### Using legacy IPython 2.x version
# Install custom kernels
IJulia.installkernel("Julia O3", "-O3")
IJulia.installkernel("Julia (4 threads)", env=Dict("JULIA_NUM_THREADS"=>"4"))
```

We recognize that some users may need to use legacy IPython 2.x. You
can do this by checkout out the `ipython2` branch of the IJulia package:
With `IJULIA_NODEFAULTKERNEL` set, [`IJulia.notebook()`](@ref) will not
auto-install the default kernel. You can still manually install the default
kernel by calling [`IJulia.installkernel()`](@ref) without arguments.

```julia
Pkg.checkout("IJulia", "ipython2")
Pkg.build("IJulia")
```
## Low-level IPython Installations

We recommend using IPython 7.15 or later as well as Python 3.

### Manual installation of IPython

Expand Down Expand Up @@ -165,8 +172,10 @@ Once IPython 3.0+ and Julia 0.7+ are installed, you can install IJulia from a Ju
Pkg.add("IJulia")
```

This will download IJulia and a few other prerequisites, and will set up a
Julia kernel for IPython.
This will download IJulia and a few other prerequisites. The Julia kernel will be
automatically installed the first time you run [`IJulia.notebook()`](@ref) or
[`IJulia.jupyterlab()`](@ref).

If the command above returns an error, you may need to run `Pkg.update()`, then
retry it, or possibly run `Pkg.build("IJulia")` to force a rebuild.
retry it. If you need to reinstall the kernel, run
[`IJulia.installkernel()`](@ref).
31 changes: 14 additions & 17 deletions docs/src/manual/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Or, explore the data directory relevant to your system, e.g.,
`~/.local/share/jupyter/kernels`.

Make sure that you can find a Julia kernel. If you can't, run
[`IJulia.installkernel`](@ref), e.g., as `import IJulia;
IJulia.installkernel("Julia", "--project=@.")` in the Julia REPL.
[`IJulia.installkernel()`](@ref) in the Julia REPL.

The `kernel.json` file for the `IJulia` kernel should look something like this:
```json
Expand Down Expand Up @@ -72,7 +71,7 @@ You can edit the `kernel.json` file to fix any issues. Or, delete the entire
folder containing the `kernel.json` file to start from scratch. This is entirely
safe to do, or you could also use `jupyter kernelspec uninstall <name>` from the
command line, see `jupyter kernelspec --help`. After deleting an old kernel,
simply create a new one, using [`IJulia.installkernel`](@ref) from the Julia
simply create a new one, using [`IJulia.installkernel()`](@ref) from the Julia
REPL.

For further insight into kernel connection issues, look at the error messages
Expand All @@ -86,14 +85,14 @@ cf. [Debugging IJulia problems](@ref), below.

## General troubleshooting tips

* If you ran into a problem with the above steps, after fixing the
problem you can type `Pkg.build()` to try to rerun the install scripts.
* If you tried it a while ago, try running `Pkg.update()` and try again:
this will fetch the latest versions of the Julia packages in case
the problem you saw was fixed. Run `Pkg.build("IJulia")` if your Julia
version may have changed. If this doesn't work, you could try just deleting
the whole `.julia/conda` directory in your home directory (on Windows, it is
called `Users\USERNAME\.julia\conda` in your home directory) via
* If you ran into a problem with the above steps, after fixing the problem you
can run [`IJulia.installkernel()`](@ref) to try to reinstall the kernel.
* If you tried it a while ago, try running `Pkg.update()` and try again: this
will fetch the latest versions of the Julia packages in case the problem you
saw was fixed. Run [`IJulia.installkernel()`](@ref) if your Julia version may
have changed. If this doesn't work, you could try just deleting the whole
`.julia/conda` directory in your home directory (on Windows, it is called
`Users\USERNAME\.julia\conda` in your home directory) via
`rm(abspath(first(DEPOT_PATH), "conda"),recursive=true)` in Julia and
re-adding the packages.
* On MacOS, you currently need MacOS 10.7 or later; [MacOS 10.6 doesn't
Expand All @@ -118,7 +117,7 @@ cf. [Debugging IJulia problems](@ref), below.
kernel that uses your required `Project.toml` (see [Julia projects](@ref)).
* Try running `jupyter --version` and make sure that it prints `3.0.0` or
larger; earlier versions of IPython are no longer supported by IJulia.
* You can try setting `ENV["JUPYTER"]=""; Pkg.build("IJulia")` to force IJulia
* You can try running `IJulia.update_jupyter_path("")` to force IJulia
to go back to its own Conda-based Jupyter version (if you previously tried a
different `jupyter`).

Expand All @@ -127,17 +126,15 @@ cf. [Debugging IJulia problems](@ref), below.

If IJulia is crashing (e.g. it gives you a "kernel appears to have
died" message), you can modify it to print more descriptive error
messages to the terminal by doing:
messages to the terminal by setting the `IJULIA_DEBUG` environment variable:

```julia
ENV["IJULIA_DEBUG"]=true
Pkg.build("IJulia")
```

Restart the notebook and look for the error message when IJulia dies.
Restart the notebook, and look for the error message when IJulia dies.
(This changes IJulia to default to `verbose = true` mode, and sets
`capture_stderr = false`, hopefully sending a bunch of debugging to
the terminal where you launched `jupyter`).

When you are done, set `ENV["IJULIA_DEBUG"]=false` and re-run
`Pkg.build("IJulia")` to turn off the debugging output.
When you are done, set `ENV["IJULIA_DEBUG"]=false` to turn off the debugging output.
Loading