I have tried answers posted here
But I still can't fix the same issue. Here is my python code:
import xlrd
import pandas as pd
from pandas import ExcelWriter
from pandas import ExcelFile
df = pd.read_excel('airquality.xlsx')
print("Column headings:")
print(df.columns)
:!python 'readexcel.py'
Traceback (most recent call last):
File "readexcel.py", line 1, in <module>
import xlrd
ImportError: No module named xlrd
shell returned 1
While I check the xlrd it shows it has been satisfied:
$python --version
Python 3.6.9
$ pip3 install xlrd
Requirement already satisfied: xlrd in /usr/local/lib/python3.6/dist-packages (1.2.0)
while in terminal, it seems no issue:
python
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlrd
>>>