sandy
sandy

Reputation: 1072

Python: [Errno 2] No such file or directory:

I have imported Python Project in Eclipse. When i run the script on mac machine i am getting error as below:

[Errno 2] No such file or directory: '/Users/noimac-mini4/Documents/workspace/MobileAutomationPy\\..\\..\\..\\..\\'

what could be possible cause of error here?

Same project imported in windows machine and it is working fine but not in mac

Upvotes: 0

Views: 145

Answers (1)

Alexander
Alexander

Reputation: 12775

What i see here is a lot of backslashes (\) in your path which are used on Windows platforms, that is why it works when imported on Windows machine. My guess would be that you have this path stored inside a string or something.

Better approach would be to use os.path and os.sep when dealing with platform independent path's.

Upvotes: 2

Related Questions