I am using Spyder and I am trying to get Python Anaconda working on Ubuntu.
I am trying to test this code:
import pandas as pd
import quandl
df = quandl.get("WIKI/GOOGL")
print(df.head())
but I get ModuleNotFoundError : No Module named pandas
I have installed pandas in both ways:
conda install -c anaconda pandas
and
pip3 install pandas
yet I am still getting the error.
In this instance, it appears that all you needed to was restart the kernel. When you install a new package, if you are using ipython, jupyternotebook, or spyder you should restart the kernel. This is why python -c "import pandas"
worked, whereas in your python session, it wasn't working.
A running python kernel does not search for new packages since it started running. Starting and stopping will make sure it will find the new packages. There are probably ways to find new packages without restarting the kernel, probably by using some of importlab
functions, but not sure if this would be necessary.