Am I able to have python read my excel spreadsheet from Codecademy "Workspace"?

Hello all,
I am fairly new to all of this. So, here is my silly question: In codecademy’s “workspace”, I was trying to process some excel spreadsheets using python. Would I be able to do that here on the codecademy “Workspace” or would I have to install my own python program to do that?
I ask, because I am using the code: names = pd.read_excel(r"C:\Users\Da_me\Documents\Test.xlsx") to access an excel spreadsheet on my computer. However, when I do so, I get the error:

"
Traceback (most recent call last):
File “script1.py”, line 8, in
names = pd.read_excel(r"C:\Users\Da_me\Documents\Test.xlsx")
File “/usr/local/lib/python3.6/dist-packages/pandas/util/_decorators.py”, line 208, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_base.py”, line 310, in read_excel
io = ExcelFile(io, engine=engine)
File “/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_base.py”, line 819, in init
self._reader = self._enginesengine
File “/usr/local/lib/python3.6/dist-packages/pandas/io/excel/_xlrd.py”, line 20, in init
import_optional_dependency(“xlrd”, extra=err_msg)
File “/usr/local/lib/python3.6/dist-packages/pandas/compat/_optional.py”, line 93, in import_optional_dependency
raise ImportError(message.format(name=name, extra=extra)) from None
ImportError: Missing optional dependency ‘xlrd’. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.
"

I see at the bottom that I need to use “pip” to install “xlrd”, but wouldn’t that already be installed on the codecademy website or would I need it on my computer too?

Update: I just used the command window to install “xlrd” using pip on my computer and I still get the same result above. So, if installing it on my computer was the requirement, what am I doing wrong? Or, what am I missing?

You can’t upload or import an excel spreadsheet (or csv file) to the workspace. Try using Jupyter Notebook or Google Colab (which is very similar & built like Jupyter and an app that you add to your google Drive).

3 Likes

Thank you so much for your reply! I will go ahead and do that. Thanks again! :slightly_smiling_face:
Cheers!

2 Likes