Quandl not working in Jupyter Notebook (but working at command-prompt)
Asked Answered
D

1

0

I have already installed quandl library at command prompt using command:

pip3 install quandl

And I am able to use various quandl methods.

But in my Jupyter Notebook, when I do "import quandl", it says:

No module named 'quandl'

I have restarted Jupyter notebook, even then the same results.

Other modules like Numpy, Pandas, Matplotlib work fine for me at the command-prompt and also in Jupyter Notebooks.

I have already gone through other posts mentioning the same issue, but all of them just mention the pip3 install command - which I have already done from command prompt.

Delphina answered 24/10, 2019 at 14:19 Comment(3)
help('modules') at command-prompt mentions quandl, but help('modules') in Jupyter Notebook does not mention quandl.Delphina
sys.executable at command prompt gives: "C:\\Users\\Public.DESKTOP-6RBQT7L\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe" and Jupyter Notebook gives "C:\\ProgramData\\Anaconda3\\python.exe". Not sure what am I supposed to do now. Which command should I use in Jupyter Notebook to install quandl in the folder of Jupyter Notebook?Delphina
Finally got to make it work. Installed quandl through Anaconda Powershell Prompt (not the regular Anaconda Prompt). It depreciated some of my libraries, but finally it is working! Spent 1.5 days to fix this!! Thanks.Delphina
U
0

This happens because the active env on your command line is not the same as your Jupyter Notebook's.

The solution is to make your Notebook use the same env as your command line's active env. You do that by changing the IPython Kernel in your Jupyter Notebook to one that uses the intended env:

  • Go to Menu options / Kernel
  • Change kernel
  • <Select the kernel>

If you don't see an appropriate kernel, you'll need to create a new one. To do that, from your command line (where you installed quandl), run this command:

python -m ipykernel install --user --name finance --display-name "Python (finance)"

This creates a kernel with the name of finance (as stored in the file system) and the display name of Python (finance) (as shown on the Kernel menu in Jupyter Notebooks).

Note: you'll need to restart the kernel in your Notebook (Menu / Kernel / Restart) to see the new one.

Here's more info on IPython Kernels.

Uretic answered 14/11, 2019 at 23:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.