-2

This is my first time to use Ubuntu

I am using Spyder

I am following instructions I find on the ineternet

Now I am stuck

I am trying to get Python Anaconda working on Ubuntu

I installed it

trying now to test my first code

simple 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 panadas in both ways

conda install -c anaconda pandas

and

pip3 install pandas

both ways installed

yet I am still getting same error

ModuleNotFoundError : No Module named pandas

enter image description here

asmgx
  • 7,328
  • 15
  • 82
  • 143
  • 1
    What is the outcome when you run `pip3 install pandas` ? – Higor Rossato Mar 20 '19 at 11:49
  • 1
    Similarly, what is the outcome if you run `python -c "import pandas"` – erncyp Mar 20 '19 at 11:59
  • @erncyp many thanks it works using python -c "import pandas" – asmgx Mar 20 '19 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 – asmgx Mar 20 '19 at 12:12
  • Have you tried to install using `pip` instead of `pip3`? How are you running those commands? Can you give us more details?! – Higor Rossato Mar 20 '19 at 12:24
  • @asmgx, please see my answer below. Maybe you just need to restart jupyter kernel if you are using jupyter? – erncyp Mar 20 '19 at 12:55
  • 1
    Possible duplicate of [Jupyter Notebook can't find modules for python 3.6](https://stackoverflow.com/questions/50914761/jupyter-notebook-cant-find-modules-for-python-3-6) – tripleee Mar 20 '19 at 12:56
  • Installed Anaconda how, where? Running your Python code how, where? – tripleee Mar 20 '19 at 12:58

1 Answers1

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.

erncyp
  • 1,649
  • 21
  • 23