I have installed anaconda Python 2.7 on my AWS workspace with Windows 10 and I launch Jupyter Notebook from the anaconda command prompt. When I try to create a new notebook, I have an error:
[I 20:20:23.697 NotebookApp] Creating new notebook in
[W 20:20:23.795 NotebookApp] 403 POST /api/contents (::1): Permission denied: Untitled.ipynb
[W 20:20:23.796 NotebookApp] Permission denied: Untitled.ipynb
Could you please help? I have tried to look for a solution but it is not clear what needs to be done for Windows 10.
I'm not using AWS, but maybe this can help:
When I launched
jupyter notebook
from the anaconda command prompt, while starting up one of the first lines in the log in that command prompt window said:
[I <some timestamp> NotebookApp] Serving notebooks from local directory: C:\
Unfortunately, I don't have permissions to write into the C:\ directory.
So I generated a configuration file
jupyter notebook --generate-config
that ended up as jupyter_notebook_config.py in
%USERPROFILE%\.jupyter
Use
jupyter --paths
to see which directories your Jupyter on AWS is searching for config files.
Finally, in that config file there is a line you can comment out and point to the directory that should contain your notebooks (and kernels):
## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''
Of course, make sure the directory that you mention on that line is actually (created and) writeable by you.
You should just need to ensure that you (or more specifically the user running the program) has write-permissions on the folder where the new file Untitled.ipynb is being created. See this page on changing Windows 10 folder permissions for details.
Related
How do I change Jupyter Notebook's start-up folder to be the directory that I started it in terminal? I have tried jupyter notebook --notebook-dir=%CD% but it gave me an error:
[C 00:31:27.239 NotebookApp] Bad config encountered during initialization:
[C 00:31:27.239 NotebookApp] No such notebook dir: ''/Users/username/%CD%''
Is there a better way to change start-up folder on Jupyter Notebook? Thanks very much in advance.
If I cd into a directory then both jupyter notebook and jupyter lab start in the current folder.
I am running Ventura (13.1).
I changed the configuration of Jupiter Notebook and it worked. Here are the steps:
find the configuration dir at jupyter --config-dir
In the configuration dir, edit jupyter_notebook_config.py and change to or add this line c.NotebookApp.notebook_dir = ''
Now it will start from where the starting directory is.
I have installed Jupyter Notebook on Windows 10. When I run the
jupyter notebook
command from cmd, the notebook dashboard opens in the browser. But when I try to create a notebook using the new>python3 option, I get an error message which says 'Permission denied.'
Please help me out.
You could use jupyter-lab --notebook-dir=%USERPROFILE% to always open in your home folder, which should have writable permissions
By default, Jupyter will use the directory where you started the command
In Windows 10 cmd.exe I can start jupyter in a current directory by following command:
jupyter notebook --notebook-dir="."
The current directory is C:\Users\Евгений\Documents\GitHub\sandbox
However, when I start simply jupyter notebook in a current directory above my working directory for jupyter is D:/git:
λ cd
C:\Users\Евгений\Documents\GitHub\sandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:\Anaconda3\lib\site-packages\jupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:\Anaconda3\share\jupyter\lab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
Note the last line Serving notebooks from local directory: D:/git. Where is D:/git may be coming from? Are there environment variables other than these affecting working directory choice?
My %USERPROFILE%/.jupyter is totally empty.
jupyter --config-dir directs to C:\Users\Евгений\.jupyter, it is %USERPROFILE%/.jupyter.
I read various threads about jupyter invoke, in particular:
this large thread suggests jupyter notebook will behave differently in cmd.exe and Anaconda prompt, without further details though
Problems with configuring Jupyter start directory addresses an issue with Windows shortcut, similar to this Windows app start steps
this post proposes wrapping --notebook-dir="." key into a .bat file
My other thought is that %USERPROFILE% with non-Latin character is not be recongnisable by jupyter, but %USERPROFILE%/.jupyter is empty anyways.
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:\Users\%username%\.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple :
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:\Users\username\.jupyter\jupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
Using docker and the images maintained by the Jupyter team:
docker run -v `pwd`:/home/jovyan -p 8890:8888 jupyter/scipy-notebook
I have installed anaconda on C:\Users\My_name\AppData\Local\Continuum\Anaconda2, the issue is that whenever I launch jupyternotebook or any other from the anaconda navigator the starting directory is a external network location Z:. I want jupyter to be installed and run on C:\ how do I solve it?
Here is a copy of the anaconda command prompt so you better understand what I mean.
I have already reinstalled anaconda making sure that I select the C:\ directory, even installing offline so the computer has no acces to Z:, but the result is the same. Any ideas on how to solve it?
I defined a new windows PATH variable to ~\Anaconda2\Scripts. Then I can start jupyter notebook anywhere just by tiping "jupyter notebook" on the command line.
For MacOS, edit this file:
/Users/{your user name}/anaconda/bin/jupyter_mac.command
Original was:
DIR=$(dirname $0)<br/>
$DIR/jupyter-notebook
I added a line:
DIR=$(dirname $0)<br/>
cd /Users/{your user name}/{whatever folder you want}/<br/>
$DIR/jupyter-notebook
This way, Jupyter notebook starts directory you want. Be careful about folder names with space. Use \ before the space. For example, the Google Drive folder shoule be:
cd /Users/{your user name}/Google\ Drive/
I've installed Anaconda 2.5 w/Python 2.7. Upon launching jupyter (which is bundled in Anaconda), the python kernel isn't being detected.
The web server launches and listens on 8888. The browser notebook editor works fine. However, I can't run any python code. The "Cell" menu isn't appearing.
Is there a configuration file or something that needs to be installed?
Here's the output from the console:
[I 21:32:27.625 NotebookApp] Serving notebooks from local directory: C:\Users\smilesydney
[I 21:32:27.625 NotebookApp] **0 active kernels**
[I 21:32:27.625 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 21:32:27.627 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
The default port 8888 is blocked, I think.
For single launch this should help:
jupyter notebook --port=8889
To fix that permanently run:
jupyter notebook --generate-config
Then go to ./anaconda/ directory and add
c = get_config()
c.NotebookApp.port = 8889
to file jupyter_notebook_config.py
I fixed that through upgrading the Jupyter in Anaconda.
See https://github.com/jupyter/notebook/issues/2382 for more details.
I had the same issue. Reinstalling ipython solved the problem.
Simply restart the jupyter notebook solved the problem for me.
If one restart doesn't help, restart it again.