WolframResearch / WolframLanguageForJupyter

Wolfram Language kernel for Jupyter notebooks
MIT License
1.05k stars 126 forks source link

Jupyter installation on Environment["PATH"] not found. #63

Closed haihan-yu closed 4 years ago

haihan-yu commented 5 years ago

When I use the Wolfram Language method, after I input ConfigureJupyter["Add"] ConfigureJupyter::notfound Jupyter installation on Environment["PATH"] not found.

When I use Wolframscript, after I input jupyter kernelspec list it returns jupyter kernelspec list

I use a macOS 10 Catalina system with anaconda. How should I add path? Thanks a lot!

cc-wr commented 4 years ago

Hello, sorry for the delay,

Jupyter is usually added to PATH when it is installed.

Do you know Jupyter's installation directory? If you do, can you comment it here? ConfigureJupyter["Add"] can take an option specifying the exact location of jupyter.

Thanks!

fxinwei commented 4 years ago

Hi, I have the same problem during installation. My jupyter is installed as default by anaconda, where can i find the correct jupyter directory? My system is ubuntu 16.04

slabko commented 4 years ago

I have the same situation, my jupyter in PATH:

root@9f23a3d227cb:~/WolframLanguageForJupyter# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@9f23a3d227cb:~/WolframLanguageForJupyter# which jupyter
/usr/local/bin/jupyter

But the interesting thing is that wolframscript seems to change the path

root@9f23a3d227cb:~/WolframLanguageForJupyter# wolframscript 
Wolfram Language 12.0.1 Engine for Linux x86 (64-bit)
Copyright 1988-2019 Wolfram Research, Inc.

In[1]:= Environment["PATH"]                                                                                                                                                                                              

Out[1]= /usr/local/Wolfram/WolframEngine/12.0/Executables:/usr/local/Wolfram/WolframEngine/12.0/SystemFiles/Graphics/Binaries/Linux-x86-64:/usr/local/sbin:/usr/bin:/bin

Regarding my setup, I'm trying to run everything in docker:

in short, first installed run the container

docker run -ti --rm -p 8888:8888 -v /home/slabko/Downloads/:/volume/ ubuntu:18.04 bash

Wolfram Engine installation file will be in /volume/WolframEngine_12.0.1_LINUX.sh

Then installed some tools

apt update && apt install -y curl git avahi-daemon wget sshpass sudo locales locales-all ssh vim expect libfontconfig1 libgl1-mesa-glx libasound2 python3 python3-pip

echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen

The installed the language

sh /volume/WolframEngine_12.0.1_LINUX.sh

Entered my wolfram ID and password and then checked that it works

pip3 install jupyter
jupyter notebook --ip=0.0.0.0 --no-browser --allow-root

Exited jupyter and started installing Wolfram Language Kernel

cd ~
git clone https://github.com/WolframResearch/WolframLanguageForJupyter.git
cd WolframLanguageForJupyter
./configure-jupyter.wls add

Got error:

configure-jupyter.wls: Jupyter installation on Environment["PATH"] not found

Hope it helps to nail down the issue. Please ask if you need any help!

hanada-yasutaka commented 4 years ago

I also got the same issue on jupyter on anaconda in ubuntu 18.04 environment, but I could solved it.

First I checked the Environment["PATH"] on WolframKernel

$ WolframKernel
Wolfram Language 12.0.1 Engine for Linux x86 (64-bit)
Copyright 1988-2019 Wolfram Research, Inc.

In[1]:= Environment["PATH"]                                                                                                  
Out[1]= /usr/local/Wolfram/WolframEngine/12.0/Executables:/usr/local/Wolfram/WolframEngine/12.0/SystemFiles/Graphics/Binaries/Linux-x86-64:/home/hanada/Applications/julia-1.3.0/bin:/usr/bin:/bin

WolframKernel does not found the PATH to anaconda. Thus, I mamually edit configure-jupyter.wls to add anadonda (jupyter) path by following way:

$ head configure-jupyter.wls 
#!/usr/bin/env wolframscript

path0 = Environment["PATH"]<>":/home/hanada/Applications/anaconda3/bin"
SetEnvironment["PATH"->path0]  

Begin["WolframLanguageForJupyter`Private`"];

Then I run

$ ./configure-jupyter.wls add

After this command, there is no text, but I can run Wolfram Language on jupyter notebook.

haihan-yu commented 4 years ago

Thanks for your suggestion. It works for me now

cc-wr commented 4 years ago

@hanada-yasutaka, @haihan-yu, note that a command-line invocation like the following should work without having to change configure-jupyter.wls.

./configure-jupyter.wls add "/path/to/WolframKernel" "/home/hanada/Applications/anaconda3/bin/jupyter"

(This invocation should automatically edit PATH as @hanada-yasutaka has done manually. See the section of configure-jupyter.wls at https://github.com/WolframResearch/WolframLanguageForJupyter/blob/master/configure-jupyter.wls#L287.)

bfrangi commented 2 years ago

I had the same problem, but I fixed it by running the configure-jupyter.wls with the conda environment where I had jupyter installed activated. No need to modify configure-jupyter.wls.

Just a suggestion to try :)