# Accessing local folder using online Jupyter

**URL:** https://discourse.jupyter.org/t/accessing-local-folder-using-online-jupyter/9523
**Category:** Notebook
**Tags:** help-wanted
**Created:** [June 9, 2021, 7:31am UTC](https://discourse.jupyter.org/t/accessing-local-folder-using-online-jupyter/9523 "2021-06-09T07:31:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![acerNZ](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/acernz/32/2904_2.png) [@acerNZ](https://discourse.jupyter.org/u/acerNZ)
#### Post date: [June 9, 2021, 7:31am UTC](https://discourse.jupyter.org/t/accessing-local-folder-using-online-jupyter/9523/1 "2021-06-09T07:31:25Z")

</div>

Hi Experts,  
I cannot install Anaconda or any other python application on my system. I am using jupyter online.

I need your help.  
How to find the current working directory.

1. How to change the Jupyter notebook current working directory to import os

```auto
# Function to Get the current `Preformatted text`
# working directory
def current_path():
    print("Current working directory before")
    print(os.getcwd())
    print()
    
# Driver's code
# Printing CWD before
current_path()
# Changing the CWD
os.chdir('../../')
# Printing CWD after
current_path()
**> OUTPUT : Current working directory before**
 **> /**
os.chdir('C:/Data/CCSRP')
current_path()

```

\*\*\> OUTPUT: \*\*  
**\> ---------------------------------------------------------------------------**  
**\> FileNotFoundError Traceback (most recent call last)**  
**\> in**   
**\> 18 current\_path()**  
\*\*\> 19 \*\*  
**\> —\> 20 os.chdir(‘C:’)**  
**\> 21 current\_path()**  
\*\*\> 22 \*\*  
\*\*\> \*\*  
**\> FileNotFoundError: [Errno 2] No such file or directory: 'C:**’  
The command to change directory is throwing me error.  
I am not even able to change the directory to “C:”

Please can you help ?

Regards

---

<div class="post-metadata">

### Author: ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)
#### Post date: [June 9, 2021, 3:34pm UTC](https://discourse.jupyter.org/t/accessing-local-folder-using-online-jupyter/9523/2 "2021-06-09T15:34:57Z")

</div>

Hi

The working directory and directory paths relate to the environment that the notebook server is running on, not the desktop of the browser environment you are using to view a hosted notebook with.

If the Jupyter server you are accessing notebooks from is running on a server in a server farm in Amsterdam, or London or San Francisco, then the file paths relate to a virtual machine running on a server in a server rack in one of those locations.

You can upload files to a Jupyter notebook directory (from the classic notebook homepage, for example), or pull in files using tools like [`nbgitpuller`](https://jupyterhub.github.io/nbgitpuller/). You can export files to your desktop using tools like [`nbzip`](https://github.com/data-8/nbzip). And you can also work with files saved to local browser storage using [`jupyter-offlinenotebook`](https://jupyter-offlinenotebookhttps://github.com/manics/jupyter-offlinenotebook).

Another thing to note is that a notebook server is started in a particular directory on a particular filesystem and you cannot navigate to notebooks above that directory in the classic notebook homepage file view, although you can navigate to arbitrary directories on the command line / using shell commands.

---

<div class="post-metadata">

### Author: ![acerNZ](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/acernz/32/2904_2.png) [@acerNZ](https://discourse.jupyter.org/u/acerNZ)
#### Post date: [June 9, 2021, 10:33pm UTC](https://discourse.jupyter.org/t/accessing-local-folder-using-online-jupyter/9523/3 "2021-06-09T22:33:50Z")

</div>

@ [psychemedia] Thank you very much.  
([Profile - psychemedia - Jupyter Community Forum](https://discourse.jupyter.org/u/psychemedia))  
Unfortunately, my place of work doesn’t allow me to install, upload data.

Please can you help me with links or help to read access  
data from weblink, I have data from view source of the application, I am trying to extract data using regular expressions.

I need this logic

1. From Jupiter, ability to read the websource link
2. Using regular expressions and output to text file

---

<div class="post-metadata">

### Author: ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)
#### Post date: [June 13, 2021, 7:12pm UTC](https://discourse.jupyter.org/t/accessing-local-folder-using-online-jupyter/9523/4 "2021-06-13T19:12:19Z")

</div>

One of the more straightforward ways of reading a URL in Python is via the [requests](https://docs.python-requests.org/en/master/index.html) package. But that is more of a Python question than a Jupyter question.

If you then need to parse files, or scrape data, then search for packages to do with screenscraping (things like [beautifulsoup](https://beautiful-soup-4.readthedocs.io/en/latest/) or [scrapy](https://scrapy.org/).

But based on your previous comment, if you are viewing a local file in a browser (eg as `file:///Users/YOURUSER/Path/datafile.csv`) then running a Python environment launched via MyBinder on a server a thousand miles away won’t be able to see that location. You can only load remote data files if they are resolvable using something like http or ftp.

Can’t you just upload the file?

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/1/17de3d8d4e387b07d0958be82e87593407a06806.png)
