Reputation: 795
I have python versions 3.6.5_1
and 3.7.0
installed via Homebrew.
jupyter
needs python3.6
for launching. It wouldn't start if I switch to python3.7
.
After launching, it fails to start the kernel with this error:
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/opt/python/bin/python3.7': '/usr/local/opt/python/bin/python3.7'
From what I understand, the kernel is looking for python3.7
. My kernel list has just python3
$jupyter kernelspec list
Available kernels:
python3 /usr/local/etc/jupyter/kernels/python3
I looked at this link on github, but it wasn't helpful. How do I make jupyter and the kernel running on the same python version?
Upvotes: 19
Views: 84377
Reputation: 46
netsh winsock reset
In cmd with administrator, Please implement above order
Upvotes: 0
Reputation: 29
step 2 command:
conda activate <location of your env folder>
step 3 command:
python -m ipykernel install --user
works!
Upvotes: 1
Reputation: 682
I had same issue - tried all the above without success.
Context: using Windows on that machine, for a few years. I have used this machine as a "code on the go when I need to" laptop and have not been very careful nor consistent when installing/upgrading python versions or libraries or environments.
The fix for me - somehow a folder that contained f2py.exe (Numpy - on top of which Pandas is built) was not in the path and was in a hidden folder that ended with "\Scripts". Python itself was fine in the environment variables. They were in very different folders - while normally they should be in close branches in the folder tree. Adding the full path of the folder ending with "\Scripts" that have f2py.exe in the environment variables solved the kernel issue for me.
Upvotes: 0
Reputation: 2144
Updating the jupyter notebook resolved the issue for me. But remember, update it using command line. Not Anaconda Navigator
pip install -U jupyter
Upvotes: 12
Reputation: 601
In case anyone anyone reading this who runs Jupyter Notebook from within Anaconda and gets the same error:
I found a workaround by installing Jupyter using pip in the command prompt (not anaconda prompt):
$pip install jupyter
and then start Jupyter using the known way
$cd 'DirectoryofyourNotebook'
$jupyter notebook
Upvotes: 2
Reputation: 795
Check the kernel specifications:
$jupyter kernelspec list
This will show you the available kernels. In this case:
python3 /usr/local/etc/jupyter/kernels/python3
Open the kernel.json
file in this directory and specify the path of python you want the kernel to use in the argv
key.
Upvotes: 27