Hello I am very new to Python just having installed Python Version 2.7 onto
my windows 8.1 laptop. I thought the install was successful and was
entering information for my first assignment when I received an unexpected
error.
I executed a Sheets command using an earlier generated getSheetNames
function that successfully was entered by me.
However, when I ran the Sheets command I received the following:
Import Error: No modules name Pandas
If Pandas were not included in the original install, would it not have been
caught when I input the getSheetNames function:
def getSheetNames(excelfile):
from pandas import ExcelFile
return (ExcelFile(excelfile)).sheet_names
Here again was my command:
>>> excelfile=r:"C:\Users\Larry
>>> sheets=getSheetNames
(excelfile);sheets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in
getSheetNames
ImportError: No module named pandas
>>>
I have in addition included the actual Python I executed and received the
message. It is attached in the file.
I would appreciate any help in getting this issue resolved.
If I need to install Pandas, please indicate clearly how I do using my
current ver 2.7 python install.
Thanks again for your help.
Larry Staley
650.274.6794 (c)
larrystale...@comcast.net
>>> def getSheetNames(excelfile):
... from pandas import ExcelFile
... return (ExcelFile(excelfile)).sheet_names
...
>>> excelfile=r"D:\Assignment_1_Data_and_Template.xlsx";
>>> sheets=getSheetNames(excelfile);sheets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in getSheetNames
ImportError: No module named pandas
>>> excelfile="D:\Assignment_1_Data_and_Template.xlsx";
>>> sheets=getSheetNames(excelfile);sheets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in getSheetNames
ImportError: No module named pandas
>>> excelfile=r"D:\Assignment_1_Data_and_Template.xlsx";
>>> excelfile=r:"C:\Users\Larry\Assignment_1_Data_and_Template.xlsx"
File "<stdin>", line 1
excelfile=r:"C:\Users\Larry\Assignment_1_Data_and_Template.xlsx"
^
SyntaxError: invalid syntax
>>> excelfile=r"C:\Users\Larry\Assignment_1_Data_and_Template.xlsx";
>>> sheets=getSheetNames(excelfile);sheets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in getSheetNames
ImportError: No module named pandas
>>>
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor