IPython continued to exist as a Python shell and kernel for Jupyter, but the notebook interface and other language-agnostic parts of IPython were moved under the Jupyter name. 10 11 Jupyter is language agnostic and its name is a reference to core programming languages supported by Jupyter, which are Julia, Python, and R. Installing Jupyter Notebook using Anaconda. We strongly recommend installing Python and Jupyter using the Anaconda Distribution, which includes Python, the Jupyter Notebook, and other commonly used packages for scientific computing and data science. First, download Anaconda. We recommend downloading Anaconda’s latest Python 3 version.
- Ipython For Windows 10
- Install Ipython Notebook Windows 10
- Ipython Notebook Windows 8
- Ipython Notebook Windows 10
- Ipython Notebook Jupyter Windows
- Ipython Notebook Windows 7
- How To Install Jupyter Notebook
This video series will help the user iPython. In this video we install and launch iPython.
Active7 months ago
When I open an Jupyter notebook (formerly IPython) it defaults to
C:UsersUSERNAME
.
How can I change this so to another location?
Thanks.
Matt
20.9k5 gold badges64 silver badges65 bronze badges
JohnJohn
13.8k24 gold badges69 silver badges100 bronze badges
31 Answers
12 next
jupyter notebook --help-all
could be of help:
For example:
You can of course set it in your profiles if needed, you might need to escape backslash in Windows.
Note that this will override whatever path you might have set in a jupyter_notebook_config.py file. (Where you can set a variable
Brad Solomon
c.NotebookApp.notebook_dir
that will be your default startup location.)
17k8 gold badges55 silver badges104 bronze badges
MattMatt
20.9k5 gold badges64 silver badges65 bronze badges
PythonerPythoner
2,5601 gold badge18 silver badges32 bronze badges
A neat trick for those using IPython in windows is that you can make an ipython icon in each of your project directories designed to open with the notebook pointing at that chosen project. This helps keep things separate.
For example if you have a new project in C:fakeexampledirectory
Copy an ipython notebook icon to the directory or create a new link to the windows 'cmd' shell. Then right click on the icon and 'Edit Properties'
Set the shortcut properties to:
(Note the added slash at the end of 'start in')
This runs windows command line, changes to your working directory, and runs the ipython notebook pointed at that directory.
Drop one of these in each project folder and you'll have ipython notebook groups kept nice and separate while still just a doubleclick away.
UPDATE: IPython has removed support for the command line inlining of pylab so the fix for that with this trick is to just eliminate '--pylab inline' if you have a newer IPython version (or just don't want pylab obviously).
UPDATE FOR JUPYTER NOTEBOOK ~ version 4.1.1
On my test machines and as reported in comments below, the newest jupyter build appears to check the start directory and launch with that as the working directory. This means that the working directory override is not needed.
Thus your shortcut can be as simple as:
If jupyter notebook is not in your PATH you just need to add the full directory reference in front of the command. If that doesn't work please try working from the earlier version. Very conveniently, now 'Start in:' can be empty in my tests with 4.1.1 and later. Perhaps they read this entry on SO and liked it, so long upvotes, nobody needs this anymore :)
Ezekiel KruglickEzekiel Kruglick
In iPython Notebook on Windows, this worked for me:
tucsontucson
8,32612 gold badges70 silver badges111 bronze badges
Besides @Matt's approach, one way to change the default directory to use for notebooks permanently is to change the config files. Firstly in the cmdline, type:
to initialize a profile with the default configuration file. Secondly, in file
ipython_notebook_config.py
, uncomment and edit this line:
changing
D:DocumentsDesktop
to whatever path you like.
This works for me ;)
UPDATE: There is no
René Wolferink
c.NotebookManager.notebook_dir
anymore.Now, the line to uncomment and config is this one:c.NotebookApp.notebook_dir = 'Z:username_examplefolder_that_you_whant'
3,2232 gold badges23 silver badges42 bronze badges
zhangxaochenzhangxaochen
16.5k5 gold badges39 silver badges56 bronze badges
As MrFancypants mentioned in the comments, if you are using Jupyter (which you should, since it currently supersedes the older IPython Notebook project), things are a little different. For one, there are no profiles any more.
After installing Jupyter, first check your ~/.jupyter folder to see its content. If no config files were migrated from the default IPython profile (as they weren't in my case), create a new one for Jupyter Notebook:
This generates ~/.jupyter/jupyter_notebook_config.py file with some helpfully commented possible options. To set the default directory add:
As I switch between Linux and OS X, I wanted to use a path relative to my home folder (as they differ – /Users/username and /home/username), so I set something like:
Now, whenever I run
jupyter notebook
, it opens my desired notebook folder. I also version the whole ~/.jupyter folder in my dotfiles repository that I deploy to every new work machine.
As an aside, you can still use the
metakermitmetakermit
--notebook-dir
command line option, so maybe a simple alias would suit your needs better.
10.6k7 gold badges64 silver badges87 bronze badges
Usually
$ ipython notebook
will launch the notebooks and kernels at he current working directory of the terminal.
But if you want to specify the launch directory, you can use
--notebook-dir
option as follows:
$ ipython notebook --notebook-dir=/path/to/specific/directory
9,9473 gold badges48 silver badges48 bronze badges
- Change directory to your preferred directory
- Run ipython
- Use
%cd /Enter/your/prefered/path/here/
- Use
%pwd
to check your current directory
Farhad MalekiFarhad Maleki
For Windows 10
-
Look for the jupyter_notebook_config.py in C:Usersyour_user_name.jupyter or look it up with cortana.
-
If you don't have it, then go to the cmd line and type:
jupyter notebook --generate-config
-
Open the jupyter_notebook_config.py and do a
ctrl-f
search for:c.NotebookApp.notebook_dir
-
Uncomment it by removing the #.
-
Change it to:
c.NotebookApp.notebook_dir = 'C:/your/new/path'
Note: You can put au
in front of the first'
, changeto
/
, or change the'
to'
. I don't think it matters. -
Go to your Jupyter Notebook link and right click it. Select properties. Go to the Shortcut menu and click Target. Look for %USERPROFILE%. Delete it. Save. Restart Jupyter.
7973 gold badges10 silver badges27 bronze badges
WilliamWilliam
A simpler modification to the Windows Trick above - without the need to hard-code the directory.
A) Create a batch file with the following contents: (Note: A batch file is a simple text file containing commands that can be run in the cmd window. It must have a '.bat' extension, therefore .. you'll need to disable the folder setting which hides extensions of known types)
B) Copy and paste the batch file to any folder you want to start a notebook server in.
(Make sure it's a folder that you have permission to edit. 'C:' is not a good choice.)
C) Double-click on the batch file in Windows Explorer.
The notebook server should start as it normally does.
Simon
9,2211 gold badge23 silver badges41 bronze badges
user3659645user3659645
For linux and Windows:Just modify 1 line, and you can change it.
Ipython For Windows 10
cwp.py
in
C:Users [your computer name]Anaconda2
.
Install Ipython Notebook Windows 10
os.chdir(documents_folder)
Ipython Notebook Windows 8
at the end of the file.
Change it to
os.chdir('your expected working folder')
for example: os.chdir('D:/Jupyter_folder')
It worked.
Update:
When it comes to MacOS, I couldn't find the cwp.py.Here is what I found:
Open terminal on your Macbook, run 'jupyter notebook --generate-config'.
It will create a config file at /Users/[your_username]/.jupyter/jupyter_notebook_config.py
Open the config file, then change this line #c.NotebookApp.notebook_dir = 'to c.NotebookApp.notebook_dir = 'your path' and remember un-comment this line too.
For example, I change my path to '/Users/catbuilts/JupyterProjects/'
CatbuiltsCatbuilts
To do the same trick described below for Windows in OS X, create this shell script
Call it ipython-notebook.command and make it executable.
Put it in the directory you want to work in, then double-click it.
pheonpheon
1,0032 gold badges15 silver badges27 bronze badges
When launched from the command line, the IPython Notebook will use your current working directory. I took advantage of this and created context menu entries to open it directly from Windows Explorer. No need for shortcuts or batch scripts!
I was inspired by the registry-based 'Git GUI Here/Git Bash Here' entries created by Git for Windows. This page (archived version linked) was helpful in locating the correct keys.
This first pair is for the context menu presented with nothing selected (e.g. the directory background). The notebook will open with the current directory as it's working directory.
This pair is for the context menu presented when clicking on a folder. The notebook will open with the selected folder as it's working directory.
Pay attention to
%v
vs %1
arguments or it won't work. Don't forget the quotes either. On my platform the full path to IPython Notebook is C:WinPython-32bit-2.7.6.4IPython Notebook.exe
but this value will obviously dependent on your installation.
Edit: AFAICT the full path is required even if the executable is on the system path.
patricktokeeffepatricktokeeffe
just change to the preferred directory in CMD, so if you are in
just change the path like this
the CMD cursor then will move to this folder
next you can call jupyter
anasmaticanasmatic
OS Windows 10Python Anaconda 2018 ver
CHANGE WORKING DIRECTORY OF JUPYTER NOTEBOOK BY CONFIGURATION FILE:
-
Open cmd prompt (or Anaconda Prompt), then type 'jupyter notebook --generate-config' and press enter
-
This auto create a file 'jupyter_notebook_config' in the 'C:Usersusername.jupyter' folder
-
Look for the created file 'jupyter_notebook_config'and edit it.
-
Find for #c.NotebookApp.notebook_dir = '
-
Put you're desired path inside double quote, it becomes ---> c.NotebookApp.notebook_dir = 'D:/my_folder/jupiter'
- Note the forward slash (/) is used, and the comment (#) was remove.
Hence,
Edit to becomes
- Let's modify the path of the Jupyter Notebook shortcut icon6.0 On start menu, right-click on the shortcut, open folder location.6.1 Once inside the folder, recommended to create a copy of Jupyter shortcut, 6.2 right click on the new shortcut icon to open properties,
Finally,
6.3 on Target text box, remove %USERPROFILE% at the end of path, The very long path should end with jupyter-notebook-script.py
searcch my vidJupyter Notebook - Change working folder path from default to desired path
webuserwebuser
According to official Jupyter Notebook Documentation Change
%USERPROFILE%
to your folder path
PriyanshPriyansh
Locate your ipython binary. If you have used anaconda to install ipython-notebook on a mac, chances are it will be in the
/Users/[name]/anaconda/bin/
directory
in that directory, instead of launching your notebook as
add a
--notebook-dir=<unicode>
option.
I use a bashscript in my ipython bin directory to launch my notebooks:
Note - the path to the notebook dir is relative to the ipython bin directory.
kookarakookara
Simply follow the guide on the official site, also copied below. For the first step, instead of copying the launcher, you can just go to start menu and right click to open the location.
-
Copy the Jupyter Notebook launcher from the menu to the desktop.
-
Right click on the new launcher and change the “Start in” field by pasting the full path of the folder which will contain all the notebooks.
-
Double-click on the Jupyter Notebook desktop launcher (icon shows [IPy]) to start the Jupyter Notebook App, which will open in a new browser window (or tab). Note also that a secondary terminal window (used only for error logging and for shut down) will be also opened. If only the terminal starts, try opening this address with your browser: http://localhost:8888/.
1,3585 gold badges21 silver badges47 bronze badges
On MiniConda2/Anaconda2 under Windows to change Jupyter or iPython working directory, you can modify this file:
and add your project folder location: development_folder= 'C:UsersUSERNAMEDevelopment'Which is My Username Development in my case.
also change: os.chdir(documents_folder) to os.chdir(development_folder)
Execute by using your regular Jupiter Notebook shortcuts.
Gunay AnachGunay Anach
LeewisLeewis
1261 gold badge3 silver badges14 bronze badges
I have both 32 and 64 bit python and ipython using WinPython, I wanted both 32 and 64 bit versions to point to the same working directory for ipython notebook.
I followed the above suggestions here I was still unable to get my setup working.
Here's what I did - in case anyone needs it:
It looks like Ipython notebook was using the configuration from
C:pythonPathwinpythonPathsettings.ipythonprofile_default
Even though
ipython locate
returns C:usersUsername.ipython
As a result, modifying the ipython_notebook_config.py file did nothing to change my working directory.
Yahoo app for windows 10. Additionally
ipython profile_create
was not creating the needed python files in C:pythonPathwinpythonPathsettings.ipythonprofile_default
I'm sure there's a better way, but to resolve this quickly, I copied the edited python files from
C:usersUsername.ipythonprofile_default
to C:pythonPathwinpythonPathsettings.ipythonprofile_default
Now (finally) ipython notebook 64 bit runs and provides me the correct working directory
Note on Windows I'm having no issue with the following syntax:
Neural PantherNeural Panther
If you are using ipython in linux, then follow the steps:
You can try all the commands which work in you linux terminal.
!cd /directory_name/
You can try all the commands which work in you linux terminal.
!vi file_name.py
Just specify the exclamation(!) symbol before your linux commands.
abhijeetmoteabhijeetmote
For Mac OS X with blanks in target directory (follow up to @pheon). Add extra pair of double quotes around $(..) in line 2 thus. See: https://stackoverflow.com/a/1308838 (Sean Bright)
![Windows Windows](https://s3-ap-southeast-2.amazonaws.com/lectures.quantecon.org/py/_static/figures/nb.png)
Community♦
tmntmn
I have a very effective method to save the notebooks in a desired location in windows.
- One-off activity: Make sure the path of
jupyter-notebook.exe
issaved under environment variable. - Open your desired directory either from windows explorer or by cdfrom command prompt
- From the windows explorer on your desired folder, select the addressbar(in a way that the path label is fully selected) and type
jupyter-notebook.exe
- voila!! the notebook opens from thedesired folder and any new notebook will be saved in this location.
1,3522 gold badges12 silver badges18 bronze badges
In command line before typing '
jupyter notebook
' navigate to the desired folder.
In my case my all python files are in 'D:Python'.
Then type the command 'jupyter notebook' and there you have it. You have changed your working directory.
AbhimanyuAbhimanyu
This question keeps coming up when I search for
ipython change pwd
even though I am not interested in a notebook
, but a terminal or qtconsole. Not finding a relevant config entry I tried:
This is the base level
shell
class; there are Terminal and Console (and probably notebook) entries that could further customize the action.
From the docs it looks like
import
statements are most common in the entry, but it appears that many magic commands work as well.
Ipython Notebook Windows 10
hpauljhpaulj
129k7 gold badges103 silver badges180 bronze badges
If you are using ipython in windows, then follow the steps:
- navigate to ipython notebook in programs and right click on it andgo to properties.
- In shortcut Tab , change the 'Start in' directory to your desireddirectory.
- Restart the kernal.
Ipython Notebook Jupyter Windows
Nim JNim J
5381 gold badge6 silver badges12 bronze badges
You can also use AutoHotKey with a simple script to open a Jupyter Notebook server in a default directory (CTRL+I) or a path highlighted in explorer (or elsewhere with CTRL+SHIFT+I).
zhespeltzhespelt
Upper Solution may not work for you if you have installed latest version of Python in Windows. I have installed Python 3.6.0 :: Anaconda 4.3.0 (64-bit) and I wanted to change the working directory of iPython Notebook called Jupyter and this is how it worked for me.
Step-1 : Open your CMD and type following command.
Step-2 : It has now generated a file in your .jupyter folder. For me, it's C:UsersAdmin.jupyter . There you will find a file called jupyter_notebook_config.py .Right click and edit it. Add the following line and set path of your working directory.Set your own working directory in place of 'I:STUDYY2-Trimester-1Modern Data Science'
We are done. Now you can try restarting your Jupyter Notebook. Hope this is useful to you. Thanks
Mohit RangholiyaMohit Rangholiya
Try the nbopen module. When you install and integrate it with the windows explorer, you will be able to open any notebook by double clicking on it.
Ipython Notebook Windows 7
RooRoo
12 next
How To Install Jupyter Notebook
protected by Community♦Jan 21 '18 at 16:41
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?