1

I am a Mac user and I am trying to change the cwd of the current directory to the below but it is giving me the error. Could you please suggest me how I can fix this error?

os.chdir('/Users/hdummi/Desktop/')

OSError                                   Traceback (most recent call last)
<ipython-input-24-12308fa290ee> in <module>()
----> 1 os.chdir('/Users/hdummi/Desktop/')

OSError: [Errno 2] No such file or directory: '/Users/hdummi/Desktop/'

The current path says something like:

import os
os.getcwd()

'/export/hda3/borgletdata/dirs/'
1
  • 1
    Are you perhaps on a different volume or disk? Commented Aug 12, 2017 at 15:23

1 Answer 1

1

If I had to guess based on your current path I would say you are ssh'd into a Linux computer or otherwise running the script remotely so you can't chdir into the Desktop folder on your local Mac.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Reilly. I am actually ssh'd into a Linux computer. How can I overcome this error?
If you need to access files from your local machine you will need to copy them to your remote machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.