Help with working directories

68 views
Skip to first unread message

Stefan Oste

unread,
Mar 17, 2021, 12:50:32 PM3/17/21
to Project Jupyter
Hi everyone.

I'm new to the community, transitioning over from R, and am feeling pretty frustrated over what would seem to be a simple issue.

I've been trying to set a new working directory straight to my desktop.
I've tried using the os method of chdir(), but to no avail.

The other workaround I've been looking at is uploading my datasets straight to my "Datasets" folder on the main Jupyter Files page. From here, how would I actually read the file into a notebook.

I've researched extensively on the internet and youtube to no avail. I'm looking for a real person who would be I would be willing to share 5-10 minutes of their time to walk me through it. I would even be willing to pay.

Thank you in advance for your help.
Stefan

Layne Sadler

unread,
Mar 17, 2021, 12:53:33 PM3/17/21
to Project Jupyter
Have you used JupyterLab? `pip install jupyterlab` then launch with `jupyter lab`
It provides a file explorer similar to RStudio.

`os.chdir('/path/to/files')` works 100% of the time for me. Hard to help you without you sharing the commands you ran.

Stefan Oste

unread,
Mar 17, 2021, 12:57:36 PM3/17/21
to jup...@googlegroups.com
I have tried that. Tells me it can't find the file path

--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/lA022g4UGgw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/3df8773c-8ecf-4da2-8251-2d31497b74den%40googlegroups.com.

Stefan Oste

unread,
Mar 17, 2021, 12:59:16 PM3/17/21
to jup...@googlegroups.com
I have tried the exact thing you suggested with the OS finding paths. Doesn't work. Hench my frustration and reach out to a community of people who could help me in real time. I'm appreciative of the response.

On Wed, Mar 17, 2021 at 9:53 AM Layne Sadler <layne....@gmail.com> wrote:
--

Stefan Oste

unread,
Mar 17, 2021, 1:05:44 PM3/17/21
to jup...@googlegroups.com
I can get the os.chdir() command to execute, then when i run "pwd" to see if it updated, i get:
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Stefan Oste

unread,
Mar 17, 2021, 1:07:50 PM3/17/21
to Project Jupyter
I'm looking for someone who would be available to zoom with me in real time to figure this out.

Jonathan Gutow

unread,
Mar 17, 2021, 1:08:22 PM3/17/21
to Project Jupyter
It looks to me as if you are trying to access a directory that is not below the directory in which you launched Jupyter. If you want access to your whole directory structure you will need to launch Jupyter in your root directory.

Stefan Oste

unread,
Mar 17, 2021, 1:12:08 PM3/17/21
to jup...@googlegroups.com
Thank you Jonathan... I really have no idea how to do that. I think what I'm learning toward is uploading my datasets to my Jupyter page, then accessing them from there. Still would need help on doing that. I'm a smart person, just have very little background on computer stuff and can't really make sense of it when I read a bunch of stuff online. I'm an educator by training and know that my learning style is guided/interactive. Would you be willing to show me?

Jonathan Gutow

unread,
Mar 17, 2021, 1:14:51 PM3/17/21
to Project Jupyter
Oh, are you using Jupyter on a server? If so you do need to upload the files to the server before you can access them with code in Jupyter. I though you were running Jupyter locally on your machine. Are you using Jupyter in a "Hub"? If so there should be an upload option.

Stefan Oste

unread,
Mar 17, 2021, 1:17:39 PM3/17/21
to jup...@googlegroups.com
Hi Jonathan,
I am using Anaconda, then opening Jupyter notebooks. I have figured out how to upload files into the Datasets folder. When I open a new notebook, I need to know how to read in the files from the Datasets folder.

Layne Sadler

unread,
Mar 17, 2021, 1:25:05 PM3/17/21
to Project Jupyter
Here is a good place to start: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html 

In the future, you should follow StackOverflow's process for asking people technical questions anywhere on the internet: 

Jonathan Gutow

unread,
Mar 17, 2021, 1:26:55 PM3/17/21
to Project Jupyter
Stefan,
If I understand correctly, you installed Jupyter and other tools you need using Anaconda on the computer you are working on. If you launch Jupyter from a command line, you need to make sure that you are in a directory that is above any directories you need to access in your directory structure.
For example. If you want to access stuff in <your home>/Documents/Datasets. You should make sure your command line is running in <your home> or <your home>/Documents. So I would open your terminal and issue the following commands:
```
$ cd <path-to-your home>
$ jupyter notebook
```
Then when Jupyter opens up in your browser you should be able to navigate to the Datasets directory.

Jonathan

Stefan Oste

unread,
Mar 17, 2021, 1:27:39 PM3/17/21
to jup...@googlegroups.com
I've read both of those already. Yet I am still here...

Stefan Oste

unread,
Mar 17, 2021, 1:28:51 PM3/17/21
to jup...@googlegroups.com
Hi Jonathan,
I'm not launching from a command line, but from the Anaconda application. I really just need somebody to work through this live with me.

Jonathan Gutow

unread,
Mar 17, 2021, 1:31:04 PM3/17/21
to Project Jupyter
Stefan,

I cannot provide more help. It appears you are running up against a setting in the Anaconda environment. You will need to investigate the instructions and help for Anaconda. This is not really a Jupyter issue.

Sorry,
Jonathan

Stefan Oste

unread,
Mar 17, 2021, 1:34:21 PM3/17/21
to jup...@googlegroups.com
Thanks Jonathan. I've emailed them asking for help. Can you think of any person who is well-versed in this matter who would be willing to walk me through this if I screen-shared? I'm open to paying them. I appreciate everyone's help. I am just very aware of how I learn. I just need to see it done and explained in real-time and be able to ask questions along the way.

Jason Moore

unread,
Mar 17, 2021, 3:31:26 PM3/17/21
to jup...@googlegroups.com
When you open Jupyter using Anaconda, it will open in a default directory. You'll have to put your files in that directory or in a subdirectory of that one. This may be helpful if you want to change the default directory: https://stackoverflow.com/questions/35254852/how-to-change-the-jupyter-start-up-folder

Jason

You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CA%2B-SZ7E04TtDks7EfrBkwCvGfzHJz__AAjeGMqZwq6gFxSrSrQ%40mail.gmail.com.

Jason Moore

unread,
Mar 17, 2021, 3:32:11 PM3/17/21
to jup...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages