-2

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.

enter image description here

7
  • 1
    What is the outcome when you run pip3 install pandas ? Commented Mar 20, 2019 at 11:49
  • 1
    Similarly, what is the outcome if you run python -c "import pandas" Commented Mar 20, 2019 at 11:59
  • @erncyp many thanks it works using python -c "import pandas" Commented Mar 20, 2019 at 12:07
  • @erncyp I am having the same problem with autosklearn but does not work I am getting "no module names autosklearn" although I installed as its website mentioned Commented Mar 20, 2019 at 12:12
  • 1
    Possible duplicate of Jupyter Notebook can't find modules for python 3.6 Commented Mar 20, 2019 at 12:56

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

There is nothing in the question to suggest that the OP is using Jupyter. Do you have information we don't have?
@erncyp I am using Spyder

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.