1

I imported these libraries and trying to read a CSV file on my desktop

import pandas as pd
import numpy as np

df = pd.read_csv('/Users/yoshithKotla/Desktop/canal/verymimi_M.csv')

But I get an error saying

FileNotFoundError: [Errno 2] No such file or directory: '/Users/yoshithKotla/Desktop/canal/verymimi_onlytweets_M'
2
  • 1
    The error and your code don't match up. Please include the full traceback. Commented Aug 3, 2021 at 6:19
  • @Yoshith is your problem solved by my answer if that solved your issue then mark that as accepted answer, if you like my effort you may upvote it. If any further queries ask in comment. :) Commented Aug 3, 2021 at 13:47

2 Answers 2

2

Actually you have to specify a complete path(Absolute path) like this :

C:/Users/yoshithKotla/Desktop/canal/verymimi_M.csv

If you do

/Users/yoshithKotla/Desktop/canal/verymimi_M.csv

then It will search for Users folder in working directory, which is not there so, you're getting that error.

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

9 Comments

Additionally, you have copied error from one code and your given code is different.
Please check your path. I repeated your error: FileNotFoundError: [Errno 2] No such file or directory: '/Users/yoshithKotla/Desktop/canal/verymimi_M.csv'
@lazy I don't understand your comment! Can you please explain clearly?
Rerun your code, You can see the same mistakes as me.The absolute path of the desktop is: click Disk C, click the user folder, click the window user folder, and then you can see the data on the desktop. This path is complete. As answered.
@lazy whom are you really telling that! Are you the same person who asked question? what do you mean by "Rerun your code, You can see the same mistakes as me"?
|
0

I had the same problem on online jupyter notebook and i did clear cache on my browser and my csv file opened magically

1 Comment

What do you mean specifically by 'online Jupyter Notebook'? Was it a pyodide kernel? JupyterLite? Running a full Pyton kernel on a remote machine? The original post you are posting in specifically referenced the CSV being on the Desktop and I don't think Pyodide or JupyterLite were around in 2021.

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.