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
If you use anaconda already as a distribution, stop using pip in that context. Use conda instead and you will stop having headaches. The command lines and procedures for setting up a new environment are pretty well documented here.
Basically upgrading python or having specific branches:
conda update python
conda install python=3.5
Or using specific environments:
conda create -n py35 python=3.5 anaconda
Iuse window 7 for work and I had the same problems when I tried to import Pandas. So I tried to install packages under each environment:
Run cmd and type the following code:
activate py27
conda install pandas
If the system asks you do you want to install the following new packages, choose Y for [yes]
And install pandas for each different environment if you installed Python27, Python 35 and Python 36, as I did.
Then problem solved if you run jupyter notebook again and you can import pandas successfully.
You can also solve the same problem for packages like numpy, scipy, etc..
I meet the same problem in jupyter notebook, and I run the command below and solve my problem:
!pip install pandas
I was getting the error
modulenotfounderror: no module named 'pandas'
in jupyter. I tried the command:
!pip install pandas
and it worked like a charm.
If pip3 is install you could run
!pip3 install pandas
One silly mistake that you could make is to invoke Jupyter with your local machine python installation and not the anaconda python. I had the same problem and just setting the PATH did not work for me.
FIX: By default, anaconda binaries are in "<Path_to_anaconda>/bin". For example, in my case, they are in "/home/klakhotia/anaconda3/bin". This directory will also contain the binary to anaconda jupyter. Launch the jupyter from here or create an alias in your .bashrc that points to this file.