Python: Pandas pd.read_excel giving ImportError: Install xlrd >= 0.9.0 for Excel support

前端 未结 15 2106
太阳男子
太阳男子 2021-02-01 12:04

I am trying to read a .xlsx with pandas, but get the follwing error:

data = pd.read_excel(low_memory=False, io=\"DataAnalysis1/temp1.xlsx\").fillna(         


        
15条回答
  •  余生分开走
    2021-02-01 12:18

    I encountered a similar issue trying to use xlrd in jupyter notebook. I notice you are using a virtual environment and that was the key to my issue as well. I had xlrd installed in my venv, but I had not properly installed a kernel for that virtual environment in my notebook.

    To get it to work, I created my virtual environment and activated it.

    Then... pip install ipykernel

    And then... ipython kernel install --user --name=myproject

    Finally, start jupyter notebooks and when you create a new notebook, select the name you created (in this example, 'myproject')

    Hope that helps.

提交回复
热议问题