Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing kernel #1139

Closed
janxkoci opened this issue Jan 8, 2025 · 2 comments
Closed

missing kernel #1139

janxkoci opened this issue Jan 8, 2025 · 2 comments

Comments

@janxkoci
Copy link

janxkoci commented Jan 8, 2025

I want to learn Julia, but she ain't making it easy.

I thought I finally set up a working Julia environment - I finally have working IJulia installation that can successfully connect to a kernel and open notebooks. The problem is, the notebooks are always starting in my home directory, instead of my working directory in terminal / Julia REPL, from which I start IJulia. This is kind of useless for any workflow.

I installed Julia as follows:

mamba create -n julia -c https://prefix.dev/julia-forge julia notebook jupyterlab catppuccin-jupyterlab
mamba activate julia

Then, in Julia REPL, I added IJulia:

] add IJulia

which worked fine (no more ZMQ compilation errors as when I used unofficial packages, great).

But when I try to start notebook() or jupyterlab(), it opens the interface in a browser tab, but shows my home directory instead of my current working directory, where I want to have the notebook files. The REPL says the following:

julia> notebook()
notebook = `/home/jena/miniforge3/envs/julia/bin/jupyter notebook`
[ Info: running `/home/jena/miniforge3/envs/julia/bin/jupyter notebook`
Process(setenv(`/home/jena/miniforge3/envs/julia/bin/jupyter notebook`; dir="/home/jena"), ProcessExited(0))

julia> jupyterlab()
[ Info: running `/home/jena/miniforge3/envs/julia/bin/jupyter lab`
Process(setenv(`/home/jena/miniforge3/envs/julia/bin/jupyter lab`; dir="/home/jena"), ProcessExited(0))

julia> pwd()
"/home/jena/Dropbox/Science/code/codes-for-life"

The Process(setenv(/home/jena/miniforge3/envs/julia/bin/jupyter notebook; dir="/home/jena"), ProcessExited(0)) lines appear after I shut down the notebook / jupyterlab, i.e. only the Info: lines are visible while the notebook is running.

Any idea why IJulia is switching my directories, and how do I stop it / stay in current dir?

@janxkoci
Copy link
Author

janxkoci commented Jan 8, 2025

After posting, I realized that maybe the notebook() and jupyterlab() functions take a dir argument - and they do! So after a few attempts I finally got what I want with:

wd = pwd()
jupyterlab(; dir = wd)

PPPS: Better yet:

jupyterlab(dir=".")

So I guess I can close this now. PS: actually nope, I see the wrong kernel, see bellow 👇


One more question, if I may - why do I not see my IJulia kernel when I just start jupyter-lab in terminal (with active env)? With R I can always just start jupyter directly, without going through REPL.

Could it be because I have another Julia installed globally from Manjaro repos? (This one is visible in jupyter, but some packages cannot be installed there, because again - unofficial. So I'd like to see the official one from julia-forge instead.)

PPS: I removed the globally installed Julia and now jupyterlab says I have no kernel, even when I start it with IJulia as above 😕 I'm lost..

@janxkoci janxkoci changed the title notebooks open in home directory instead of current directory missing kernel Jan 8, 2025
@janxkoci
Copy link
Author

Okay, I fixed everything by rebuilding IJulia, which was added to the environment toml by some previous installation. Still new to all of this, sorry for the spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant