close

How to change working directory in Jupyter Notebook?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to change working directory in Jupyter Notebook in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to change working directory in Jupyter Notebook?

  1. How to change working directory in Jupyter Notebook?

    You may use jupyter magic command as below
    %cd "C:\abc\xyz\"

  2. change working directory in Jupyter Notebook

    You may use jupyter magic command as below
    %cd "C:\abc\xyz\"

Method 1

Running os.chdir(NEW_PATH) will change the working directory.

import os
os.getcwd()
Out[2]:
'/tmp'
In [3]:

os.chdir('/')
In [4]:


os.getcwd()
Out[4]:
'/'
In [ ]:

Method 2

You may use jupyter magic command as below

%cd "C:\abc\xyz\"

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read