python: after installing anaconda, how to import pandas

前端 未结 13 2157
眼角桃花
眼角桃花 2021-01-31 18:00

I have installed anaconda. Now when i am trying to run

import pandas as pd

I am getting the following error

Traceback (most re         


        
13条回答
  •  被撕碎了的回忆
    2021-01-31 18:41

    You should first create a new environment in conda. From the terminal, type:

    $ conda create --name my_env pandas ipython
    

    Python will be installed automatically as part of this installation. After selecting [y] to confirm, you now need to activate this environment:

    $ source activate my_env
    

    On Windows I believe it is just:

    $ activate my_env
    

    Now, confirm installed packages:

    $ conda list
    

    Finally, start python and run your session.

    $ ipython
    

提交回复
热议问题