Jupyter python3 notebook cannot recognize pandas

后端 未结 14 1044
终归单人心
终归单人心 2020-12-14 15:56

I am using the Jupyter notebook with Python 3 selected. On the first line of a cell I am entering:

import pandas as pd

The error I get from

14条回答
  •  醉酒成梦
    2020-12-14 16:23

    As your default python version is 2.x , if you don't have any emphasis on the python 3.x you can try from the first by the below scripts.

    pip install --upgrade pip
    pip install jupyter
    

    then in jupyter notebook:

    !pip install pandas
    

    The version of notebook will be 2.x. Otherwise install pip3 by the below Linux commands.

    sudo apt-get install python3-setuptools
    sudo easy_install3 pip
    

    now you can add pandas to the notebook by !pip3 install pandas.

提交回复
热议问题