I created a Jupyter notebook inside a virtualenv environment and worked fine in the first session. However, when I tried to open the notebook again, I got the error titled Error loading notebook saying Unreadable Notebook: 'Path' NotADirectoryError(20, 'The directory name is invalid'), where 'Path' is just the local path of the notebook.
I'm able to open the notebook using Colab and it works fine. Also, it is saved inside a folder that is synced by Google Drive.
How can I open my notebook with Jupyter again?
A print screen of the error:
Thanks
I have tried reinstalling Jupyter Notebook, but the error persists.
I want to write a script to list all the .ipynb notebook files that are running on my jupyter server http://localhost:40000/tree/.
I am unable to find a command to do so, however i can only find command that lists all running servers:
jupyter notebooks list
Please list any method / shell command to do so.
I have a Jupyter .ipynb NB file in a OneDrive folder location
I want to open the .ipynb NB in my local jupyter notebook server and run it without copying the file down from the OneDrive location.
The normal way to do this with a file system is :
jupyter notebook --notebook-dir="c:\users\myaccount\nb_folders"
and it will launch the jupyter server from that folders location.
I tried to emulate this when I open a .ipynb file in a OneDrive folder that I can only access through a browser, since I cannot run the local OneDrive client (or dropbox client) on my corporate computer due to security reasons.
Instead of a file path, I want to include a OneDrive URL that points to the .ipynb file.
I typed in the following command after the command prompt >>
jupyter notebook --notebook-dir='https://onedrive.live.com/?id=8451683B31A67FC5%2111876&cid=845xxxxxx'
I get the following error that I don't know how to interpret:
[C 02:12:28.460 NotebookApp] Bad config encountered during initialization:
[C 02:12:28.460 NotebookApp] No such notebook dir: '"C:\Users\myaccount\'https:\onedrive.live.com\?id=8451683B31A67F
C5%xxxxxx"'
'cid' is not recognized as an internal or external command,
operable program or batch file.
(base) C:\Users\myaccount>>
#
The full message from the Anaconda console is:
jupyter: error: one of the arguments --version subcommand --config-dir --data-dir --runtime-dir --paths is required
'cid' is not recognized as an internal or external command,
operable program or batch file.
(base) C:\Users\myaccount>> jupyter notebook --notebook-dir='https://onedrive.live.com/?id=8451683B31A67FC5%2111876&cid=845
1683B31A67FC5'
[C 02:12:28.460 NotebookApp] Bad config encountered during initialization:
[C 02:12:28.460 NotebookApp] No such notebook dir: '"C:\Users\myaccount\'https:\onedrive.live.com\?id=8451683B31A67F
C5%xxxxxx"'
'cid' is not recognized as an internal or external command,
operable program or batch file.
ipynb file while starting a Sagemaker instance.
current status is:
Cloudwatch(success) -> Lambda(success) - > Sagemaker instance(success) -> Running Particular Notebook (failed)
1.I tried using "Sagemaker Lifecycle" config with the code
jupyter nbconvert --execute prediction-12hr.ipynb --ExecutePreprocessor.kernel_name=conda_tensorflow_p36
but getting an error
[NbConvertApp] Converting notebook prediction-12hr.ipynb to html [NbConvertApp] Executing notebook with kernel: conda_tensorflow_p36
...
raise NoSuchKernel(kernel_name) jupyter_client.kernelspec.NoSuchKernel: No such kernel named conda_tensorflow_p36
on running
`!conda env list'
conda environments:
base * /home/ec2-user/anaconda3
JupyterSystemEnv /home/ec2-user/anaconda3/envs/JupyterSystemEnv
chainer_p27 /home/ec2-user/anaconda3/envs/chainer_p27
chainer_p36 /home/ec2-user/anaconda3/envs/chainer_p36
mxnet_p27 /home/ec2-user/anaconda3/envs/mxnet_p27
mxnet_p36 /home/ec2-user/anaconda3/envs/mxnet_p36
python2 /home/ec2-user/anaconda3/envs/python2
python3 /home/ec2-user/anaconda3/envs/python3
pytorch_p27 /home/ec2-user/anaconda3/envs/pytorch_p27
pytorch_p36 /home/ec2-user/anaconda3/envs/pytorch_p36
tensorflow_p27 /home/ec2-user/anaconda3/envs/tensorflow_p27
tensorflow_p36 /home/ec2-user/anaconda3/envs/tensorflow_p36
Also tried injecting a python/bash code to run the instance startup, pausing the start-up code to wait untill conda instance is setup by sagemaker.
Still no luck
Can someone suggest a plan to run .ipynb file in anyways possible.
Try to activate the relevant Python virtualenv that the notebooks relies.
source /home/ec2-user/anaconda3/envs/tensorflow_p36/bin/activate
jupyter nbconvert --execute ...
Learn more How to activate virtualenv?
Can you try activating tensorflow_p36 env and execute notebook file in that environment? That way you don't have to specify a kernel.
source activate tensorflow_p36
jupyter nbconvert --execute prediction-12hr.ipynb
I tried to open ipython in terminal with ipython notebook and it will not open ipython notebook. It gives the following error:
| ~/documents/ud120-projects/datasets_questions # HJ (JiaHui)
| => ipython notebook
[TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and
will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in
the future
[I 14:46:50.516 NotebookApp] Serving notebooks from local directory:
/Users/JiaHui/Documents/ud120-projects/datasets_questions
[I 14:46:50.517 NotebookApp] 0 active kernels
[I 14:46:50.517 NotebookApp] The Jupyter Notebook is running at:
http://localhost:8888/?token=ef13f681f4d61223064e41a5a9e369813c155d27b0103471
[I 14:46:50.517 NotebookApp] Use Control-C to stop this server and shut down
all kernels (twice to skip confirmation).
[C 14:46:51.567 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?
token=ef13f681f4d61223064e41a5a9e369813c155d27b0103471
0:97: execution error: "http://localhost:8888/tree?
token=145eccd35722c35c6525d8a4d376f27aa60358dc7d00de4c" doesn’t understand the
“open location” message. (-1708)
I have upgraded conda jupyter but it still won't work. How can I fix this?
This issue due to the newest Mac OSX 10.12.5 upgrade. Please follow these steps to fix it:
Generate jupyter config if you don't have it:
jupyter notebook --generate-config
Use vim to open that config file and add Google chrome value in:
c.NotebookApp.browser = u'chrome' (Make sure to take out the # comment sign)
I used the same approach as Kiem Nguyen above, but 'chrome' wouldn't work for me, even after editing my .bash_profile as Hanshenry90 suggested.
To use Safari to view the notebook, open your terminal and enter:
jupyter notebook --generate-config
cd ~.jupyter
nano jupyter_notebook_config.py
ctrl + w "NotebookApp.browser" + enter to skip to that part of the file. Then delete # and change the line to:
c.NotebookApp.browser = u'Safari'
Restart your notebook, with jupyter notebook, and it should open in Safari.
If anyone has any insight on how to make this work for Chrome, that would be much appreciated.
I liked most imarti's solution:
export BROWSER=open
It is low overhead and works with your default browser
EDIT: macOS 10.12.6 has been released, so now the recommended solution is to just update your OS.
editing my nano .bash_profile file to contain the lines:
BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
export BROWSER
Not the best fix, but a potential workaround...
Go to your browser and enter the login token provided.
In your case: http://localhost:8888/
After starting a new notebook, I found that my kernel would die and be unable to restart. Updating my ipykernel fixed this:
pip install ipykernel --upgrade
This is an issue possibly due to the recent upgrade of Mac OSX. You can follow the discussion and possible solutions here, here and here.