s666
s666

Reputation: 537

Can not create a "notebook" using ipython Notebook

I have recently installed ipython using Enthought's EPD python install - and when starting the iPython HTML notebook from the command prompt by typing:

ipython notebook --pylab=inline

I manage to get the localhost browser notebook screen pop up correctly.

However when I try to create a new notebook by clicking "New Notebook" I get the following error message:

"Creating Notebook Failed The error was: Unexpected error while autosaving notebook: C:\Windows\System32\Untitled0.ipynb [Errno 17] No usable temporary file name found"

I am assuming this i sbecause I may not have write privilege for that particular drive. So I have tried to go into the "ipython_notebook_config.py" file and change the following:

# The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = u'C:\Users\Stuart\Documents\iPython' 

and

c.FileNotebookManager.notebook_dir = u'C:\Users\Stuart\Documents\iPython'

I have then closed down all the cmd windows and started the ipython notebook agaion. But when I click on "New Notebook" I get the same error message as before:

"Creating Notebook Failed The error was: Unexpected error while autosaving notebook: C:\Windows\System32\Untitled0.ipynb [Errno 17] No usable temporary file name found"

Could someone please help me as to how I can get this working? Any help very much appreciated.

Upvotes: 2

Views: 14647

Answers (6)

Edward Warren
Edward Warren

Reputation: 11

Many of the problems with Anaconda/Jupyter/Notebooks can be solved by examining and cleaning up what you have in your environmental variables such as Path or, if you trying to set up files to store Notebooks that you develop.

There is a very good discussion of environmental variables here:

http://johnatten.com/2014/12/07/adding-and-editing-path-environment-variables-in-windows/

It is obvious that if Anaconda/Jupyter/Notebook can't find the files they can't run them.

At a minimum your path in environmental variables should contain:

c:\users\*******\Anaconda3  where ******** is your user name

c:\users\*******\Anaconda3\Scripts

then you could create environmental variables that point to your personal Notebook code directories: (note: there can't be any spaces in the addresses) in Windows Environmental Variables (System Properties --> Environmental Variables --> add to User and System variables

variable  value
NOTEBOOK  address of your personal Notebook location
TESTING   address of your Notebook Testing location

With this setup you can on the Anaconda Command

 jupyter notebook %TESTING%

or jupyter notebook %NOTEBOOK%

Another way you can go to your own Notebook directory is to change

jupyter_notebook_config.py

Go to:

 ## The directory to use for notebooks and kernels.
 c.NotebookApp.notebook_dir = 'your Notebook directory address goes here'

remove the ## and enter your directory using \'s instead of \ in the address

Then anytime you enter 'jupyter notebook' you will start at your Notebook Directory.

Upvotes: 0

Sayali Sonawane
Sayali Sonawane

Reputation: 12599

I also had the same problem, I was not able to create the new notebook or access existing notebook present in that directory.

Error Message - Unexpected error while saving file:/path/ database is locked

Turns out my old anaconda jupyter notebook terminals were open and running in the background. Every time I started jupyter notebook I used the new instance that led me to this problem. When I closed all terminals and restarted new Jupyter notebook terminal it started working again.

Upvotes: 0

EbrahimA
EbrahimA

Reputation: 59

If you run the IPython as administrator you won't run into error for starting a new notebook. To do that right click on the Ipython shortcut and click on run as administrator.

Upvotes: 0

Luis Candanedo
Luis Candanedo

Reputation: 967

I just experienced the same problem. I even erased all the untitled.ipynb files in the directory. Then I realized that I had other copies of Anaconda terminal open. When I closed them and tried again, things went back to normal.

Upvotes: 1

s666
s666

Reputation: 537

The answer kindly provided by @Jakob in the comments above did the trick:

"Can you try switching to C:\Users\Stuart\Documents\iPython in the terminal before starting the notebook?"

Upvotes: 3

jfk999
jfk999

Reputation: 11

Just change the directory where are run your iPython notebook. For make it, you right-click on the shortcut and edit properties. In this properties, a field named "run directory" or something like that. Put your link in this field.

Upvotes: 1

Related Questions