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

IJulia not working on Julia 1.61. on Windows 10 #1002

Open
xiaodaigh opened this issue Apr 26, 2021 · 29 comments
Open

IJulia not working on Julia 1.61. on Windows 10 #1002

xiaodaigh opened this issue Apr 26, 2021 · 29 comments

Comments

@xiaodaigh
Copy link

I have searched the issues and I found a similar issue marked as solve in 2018 for Julia 0.7. But it's not working for me. I can see the Julia kernel but when I start a notebook I get

image

image

I have tried to ]build IJulia and reinstall Conda.jl. The python kernel works. Just the Julia one doesn't work. I have deleted the whole .julia folder and it still doesn't work.

Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = sublime_text
  JULIA_NUM_THREADS = 6
  JULIA_PKG_DEVDIR = c:/git/

@SimonDanisch
Copy link

SimonDanisch commented May 26, 2021

I've been trying IJulia ~ 3-4 times per year for a couple of years on different platforms and on windows on different machines, and I always run into this...
Is there anything we can do here?
I think IJulia hasn't been working for 2-3 years for me...On Linux I had a bunch of other issues...
Did I somehow manage to consistently have a bad environment, is this a widespread issue and IJulia isn't used that much anymore, or is everyone just going through a lot to get things going and I'm just too lazy to debug this?

@stevengj
Copy link
Member

stevengj commented May 27, 2021

Does the Python kernel work? (If so, it's unrelated to IJulia.) Oh, I see you say that the Python kernel works.

@stevengj
Copy link
Member

It works fine for me, but I don't use Windows.

Have you tried the troubleshooting tips? e.g. building IJulia in debug mode to see if you get additional output? https://julialang.github.io/IJulia.jl/stable/manual/troubleshooting/#Debugging-IJulia-problems

@SimonDanisch
Copy link

julia> ENV["IJULIA_DEBUG"]=true
julia> using Pkg
julia> Pkg.build("IJulia")
    Building Conda ─→ `C:\Users\sdani\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\299304989a5e6473d985212c28928899c74e9421\build.log`
    Building IJulia → `C:\Users\sdani\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\d8b9c31196e1dd92181cd0f5760ca2d2ffb4ac0f\build.log`
  Progress [========================================>]  2/2
2 dependencies successfully precompiled in 18 seconds (420 already precompiled)
julia> using IJulia
julia> notebook()
[ Info: running setenv(`'C:\Users\sdani\.julia\conda\3\Scripts\jupyter.exe' notebook`,["PATH=C:\\Users\\sdani\\.julia\\conda\\3\\Library\\bin;C:\\Users\\sdani\\.julia\\conda\\3\\Scripts;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Users\\sdani\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\sdani\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\sdani\\AppData\\Local\\Programs\\Julia-1.6.0\\bin;C:\\Users\\sdani\\Downloads\\nim-1.4.4\\bin;C:\\Users\\sdani\\.nimble\\bin", "USERDOMAIN_ROAMINGPROFILE=DESKTOP-VBGI3JA", "HOMEPATH=\\Users\\sdani", "PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL", "SYSTEMROOT=C:\\Windows", "APPDATA=C:\\Users\\sdani\\AppData\\Roaming", "PSMODULEPATH=C:\\Users\\sdani\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules", "COMMONPROGRAMW6432=C:\\Program Files\\Common Files", "PROGRAMDATA=C:\\ProgramData", "PUBLIC=C:\\Users\\Public", "USERDOMAIN=DESKTOP-VBGI3JA", "OS=Windows_NT", "PROCESSOR_REVISION=2100", "TMP=C:\\Users\\sdani\\AppData\\Local\\Temp", "COMSPEC=C:\\Windows\\system32\\cmd.exe",  "ALLUSERSPROFILE=C:\\ProgramData", "AMDRMPATH=C:\\Program Files\\AMD\\RyzenMaster\\", "COMPUTERNAME=DESKTOP-VBGI3JA", "USERNAME=sdani", "CONDARC=C:\\Users\\sdani\\.julia\\conda\\3\\condarc-julia.yml", "ONEDRIVECONSUMER=C:\\Users\\sdani\\OneDrive", "USERPROFILE=C:\\Users\\sdani", "PROCESSOR_LEVEL=25", "PROGRAMW6432=C:\\Program Files", "TEMP=C:\\Users\\sdani\\AppData\\Local\\Temp", "HOMEDRIVE=C:", "PYTHONIOENCODING=UTF-8", "WINDIR=C:\\Windows", "LOCALAPPDATA=C:\\Users\\sdani\\AppData\\Local", "PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD", "NUMBER_OF_PROCESSORS=16", "IJULIA_DEBUG=true", "COMMONPROGRAMFILES(X86)=C:\\Program Files (x86)\\Common Files", "COMMONPROGRAMFILES=C:\\Program Files\\Common Files", "ONEDRIVE=C:\\Users\\sdani\\OneDrive", "PROGRAMFILES(X86)=C:\\Program Files (x86)", "GIT_SSH=C:\\Windows\\System32\\OpenSSH\\ssh.exe", "OPENBLAS_NUM_THREADS=8", "PROGRAMFILES=C:\\Program Files", "LOGONSERVER=\\\\DESKTOP-VBGI3JA", "DRIVERDATA=C:\\Windows\\System32\\Drivers\\DriverData", "CONDA_PREFIX=C:\\Users\\sdani\\.julia\\conda\\3", "FPS_BROWSER_USER_PROFILE_STRING=Default", "SYSTEMDRIVE=C:", "FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer", "PROCESSOR_ARCHITECTURE=AMD64", "OPENBLAS_MAIN_FREE=1"])

Which gives me:
image

Python cell works!

How do I best run Try running jupyter --version?

@stevengj
Copy link
Member

I think you may need to run

C:\Users\sdani\.julia\conda\3\Scripts\jupyter.exe notebook

manually in a terminal if you want to see debugging output.

@xiaodaigh
Copy link
Author

for me the error is this. But I don't get this error if I run this from julia using notebook().

Also, both the Python and R kernels work. It's just the Julia one not work. I tried to google the error, but it looks like it's looking for some .dlls which I can see in some paths.

Traceback (most recent call last):
  File "C:\Users\RTX2080\.julia\conda\3\Scripts\jupyter-notebook-script.py", line 5, in <module>
    from notebook.notebookapp import main
  File "C:\Users\RTX2080\.julia\conda\3\lib\site-packages\notebook\notebookapp.py", line 60, in <module>
    from tornado import httpserver
  File "C:\Users\RTX2080\.julia\conda\3\lib\site-packages\tornado\httpserver.py", line 29, in <module>
    import ssl
  File "C:\Users\RTX2080\.julia\conda\3\lib\ssl.py", line 98, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed while importing _ssl: The specified module could not be found.

@stevengj
Copy link
Member

stevengj commented Jun 2, 2021

Just to be clear, if you launch the same Jupyter (i.e. via IJulia.notebook() or by running C:\Users\sdani\.julia\conda\3\Scripts\jupyter.exe notebook) and then open a Python notebook in that session it works?

I'm just confused because the error message above is occurring in Python, not Julia, so it seems like it should be independent of the kernel. I'm wondering if you have multiple versions of Jupyter installed on your machine and you are using a different one when you open Python notebooks.

@xiaodaigh
Copy link
Author

I'm just confused because the error message above is occurring in Python, not Julia, so it seems like it should be independent of the kernel. I'm wondering if you have multiple versions of Jupyter installed on your machine and you are using a different one when you open Python notebooks.

Hope this video addresses that:
https://user-images.githubusercontent.com/4497189/120586210-726f1680-c476-11eb-8194-a1e623a8de94.mp4

@SimonDanisch
Copy link

Wow, I just tried it again (using IJulia; notebook()) and it didn't work as usual, but I left the tab open...
1 hour later I look at the tab and it suddenly works :-O
image

The weird thing is that the kernel is still displayed as not running? Also, I actually killed the notebook() command and closed the terminal that started the notebook ...

@xiaodaigh
Copy link
Author

1 hour later

wow!

@stevengj
Copy link
Member

stevengj commented Jun 3, 2021

Wow, I just tried it again (using IJulia; notebook()) and it didn't work as usual, but I left the tab open...

I can take a few seconds to launch the kernel (longer if you just installed a new version and you have to wait for it to precompile). Maybe you just didn't wait long enough before?

(It doesn't take an hour, though!)

(It could be that Jupyter has some timeout that is too short for Julia?)

Also, I actually killed the notebook() command and closed the terminal that started the notebook ...

Are you sure you don't have another jupyter notebook instance running? You only have to launch the notebook server once and it can run an arbitrary number of kernels.

@stevengj
Copy link
Member

stevengj commented Jun 3, 2021

Check out your Jupyter config file (~/.jupyter/jupyter_notebook_config.py) to see if you've set an idle timeout. (See here.)

The default kernel_info_timeout is supposed to be 60 seconds, for example, but from your video it seems like it is timing out a lot quicker than that on your machine.

@SimonDanisch
Copy link

SimonDanisch commented Jun 3, 2021

It now suddenly started work normally after the previous adventure...

Pretty sure I waited long enough, since I first got the connection error, and now that it works its ready in seconds, and I waited for around ~60 seconds...

Are you sure you don't have another jupyter notebook instance running?

I'm pretty sure I only run using IJulia; notebook() one time and haven't tried anything before. At least I'm pretty sure about that for the first time running into this problem - for subsequent runs, I always killed the Julia process, so if I had a running notebook, it must have come from a using IJulia; notebook() gone zombie.

I will try on my laptop and see if I can reproduce the problem and make 100% sure I'm not doing something silly.
Btw, this is a pretty fresh windows install, and I've never used Python on it...
So my first try should have been a pretty vanilla:

]add IJulia; build IJulia;
using IJulia; notebook()

@xiaodaigh
Copy link
Author

, but from your video it seems like it is timing out a lot quicker than that on your machine.

I edited them out

@xiuliren
Copy link

xiuliren commented Jun 8, 2021

I got some errors install IJulia in Julia 1.6.1 as well. I am using CentOS.

(@v1.6) pkg> build IJulia
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/299304989a5e6473d985212c28928899c74e9421/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/d8b9c31196e1dd92181cd0f5760ca2d2ffb4ac0f/build.log`
ERROR: Error building `IJulia`: 
[ Info: Installing Julia kernelspec in /mnt/home/jwu/.local/share/jupyter/kernels/julia-1.6
ERROR: LoadError: IOError: sendfile: operation not supported on socket (ENOTSUP)
Stacktrace:
  [1] uv_error
    @ ./libuv.jl:97 [inlined]
  [2] sendfile(dst::Base.Filesystem.File, src::Base.Filesystem.File, src_offset::Int64, bytes::Int64)
    @ Base.Filesystem ./filesystem.jl:119
  [3] sendfile(src::String, dst::String)
    @ Base.Filesystem ./file.jl:960
  [4] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem ./file.jl:355
  [5] copy_config
    @ ~/.julia/packages/IJulia/e8kqU/deps/kspec.jl:6 [inlined]
  [6] installkernel(name::String, julia_options::String; julia::Cmd, specname::String, env::Dict{String, Any})
    @ Main ~/.julia/packages/IJulia/e8kqU/deps/kspec.jl:118
  [7] installkernel(name::String, julia_options::String)
    @ Main ~/.julia/packages/IJulia/e8kqU/deps/kspec.jl:90
  [8] top-level scope
    @ ~/.julia/packages/IJulia/e8kqU/deps/build.jl:6
  [9] include(fname::String)
    @ Base.MainInclude ./client.jl:444
 [10] top-level scope
    @ none:5
in expression starting at /mnt/home/jwu/.julia/packages/IJulia/e8kqU/deps/build.jl:3

I have tried to remove the whole .julia folder, and install it freshly, but still got this error.

I reinstalled Julia 1.5.4, IJulia installation works fine.

@stevengj
Copy link
Member

stevengj commented Jun 8, 2021

@jingpengw, that seems like an unrelated problem.
ERROR: LoadError: IOError: sendfile: operation not supported on socket (ENOTSUP) from Info: Installing Julia kernelspec in /mnt/home/jwu/.local/share/jupyter/kernels/julia-1.6 sounds like you have some problem with your filesystem permissions for /mnt/home/jwu/.local/share/jupyter/kernels.

You should open new issues for distinct problems with completely different error messages.

@longemen3000
Copy link

longemen3000 commented Jul 17, 2021

Same problem (windows 10, julia 1.6.1) . The julia kernel keeps trying to reconnect. launching a python kernel from the notebook seems fine.
Creating a new notebook works, opening one doesn't work

@xiaodaigh
Copy link
Author

xiaodaigh commented Jul 17, 2021

Is ther a reliable way to nuke everything to od with Jupyter? Perhaps it's some weird legacy setting things. But it's really annoying that it works with R and PYthon but not Julia

@SimonDanisch
Copy link

I'd be surprised if there is... I got this issue mainly on completely new windows PCs

@longemen3000
Copy link

to add more information jupyterlab() connects to the kernel,but notebook() dont

@xiaodaigh
Copy link
Author

For me, neither works

@roland-KA
Copy link

I'd be surprised if there is... I got this issue mainly on completely new windows PCs

I have the same problems on Windows as well as macOS. Installing IJulia is really a nightmare.

@jd-foster
Copy link
Contributor

jd-foster commented Dec 7, 2021

I've been able to replicate this issue on Julia 1.6.1 and IJulia 1.23.2 on both macOS and Windows, and successfully resolve it on both. To re-create the issue, I created a new Julia environment, did ]add IJulia then using IJulia; notebook(). However, if I installed IJulia in the base environment (@v1.6) then using IJulia; notebook(), this worked fine. So my suggestion based on the experiment is that the above issue may be caused by Jupyter launching the Julia kernel into an environment with IJulia not installed.
This seems to be consistent with the video of the OP #1002 (comment)

@jd-foster
Copy link
Contributor

jd-foster commented Dec 7, 2021

This can be resolved by defining a "new" kernel that activates the given environment, say notebook_env, as

kp = installkernel("Julia MyEnv", "--project=~/julia/envs/1_6/notebook_env")

then selecting that as the kernel when creating or using Jupyter in the browser.

EDIT: if you're fine working from the same top-level directory containing your Manifest.toml/Project.toml use

notebook(dir=dirname(Base.active_project()))

in place of notebook().

@SimonDanisch
Copy link

That sounds probable from my experience...
I usually always start IJulia from an env without IJulia installed in the base environment... But I guess sometimes I ended up adding it, explaining why it suddenly started working from time to time... But since i often delete my base environment, it explains why it then again often stopped working just a bit later.

@jd-foster
Copy link
Contributor

Yes, ironically it is a issue for experienced users who manage things with environments, like yourself and the OP, but not for new users adding this into their base env.

@jd-foster
Copy link
Contributor

This seems to also cover issues #975 and #1001

@shaoyifei96
Copy link

typing installkernel("Julia") in REPL worked for me ...
I have minimal setup:

  1. installed Julia
  2. ] add IJulia
  3. using IJulia
  4. installkernel("Julia")
  5. notebook(), because I don't have it installed, so just entered y to install notebook

@roland-KA
Copy link

@shaoyifei96 It works for you, because you added IJulia to the base environment of Julia. It has already been explained above, that it works in this situation, but it fails, if you use it from other environments.

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

8 participants