2

I have an exported file from python 3.7 (python installed in windows 10, under anaconda3), I want to read this file using jupyter notebook and python 3.6.9 (python installed via WSL - Windows Subsystem for Linux) I used:

df = pd.read_csv(r"D:\Data\CSV_file.csv", sep = ",",header = None,engine = "python")

But I got an error:

FileNotFoundError: [Errno 2] No such file or directory: 'D:\Data\CSV_file.csv'

I tried (csv,xlsx) formats but I had the same error. the paths of two files are (/home/user_name for python 3.6.9 and C:\Users\user_name for python 3.7). How can I read this file using jupyter notebook?

1 Answer 1

3

You have to use Linux file paths because it is acting like the Linux OS. Change r"D:\Data\CSV_file.csv" to r"/mnt/d/Data/CSV_file.csv" since /mnt/d is equivalent of D:.

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

7 Comments

Thanks but still not working, the same error message
Are you on WSL and you are typing python 3 <name of script>? What are you talking about using the Jupyter notebook?
I installed python and jupter via WSL, I want to used jupyter to read the file for future work.
Sorry, did you use mnt/c/? You probably should use /mnt/d/ cause I noticed your file is saved in the D: drive.
doesn't he needs to mount the drive first ?
|

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.