0

I am trying to create a Data Science project using some Quandl dataset, but am receiving an error on import.

As i know quandl should be imported all in lowercase, as the documentation states here and here, my import goes as follows:

import quandl

Error:

ModuleNotFoundError: No module named 'quandl'

I installed quandl using pip install quandl. My pip list output is:

Package         Version
--------------- ---------
asn1crypto      0.24.0
certifi         2019.6.16
cffi            1.12.3
chardet         3.0.4
cryptography    2.7
idna            2.8
inflection      0.3.1
more-itertools  5.0.0
ndg-httpsclient 0.5.1
numpy           1.16.4
pandas          0.24.2
pip             19.1.1
pyasn1          0.4.5
pycparser       2.19
pyOpenSSL       19.0.0
python-dateutil 2.8.0
pytz            2019.1
Quandl          3.4.8
requests        2.22.0
setuptools      41.0.1
six             1.12.0
urllib3         1.25.3
wheel           0.33.4
wincertstore    0.2

I don't have pip3, as I installed Python through my Anaconda installation. I am running a Jupyter Notebook in a virtual environment I created just for this project. Just so you know, python --version output is:

Python 3.7.3

The strange part occurs when i try running a one line python script with import quandl. This time the program runs without errors, which means that the cause of the ModuleNotFoundError: No module named 'quandl' is the jupyter notebook, which is not being able to properly find the quandl module.

As a last resource, I tried installing quandl inside jupyter notebook:

!pip install quandl
import quandl

Output:

Requirement already satisfied: quandl in c:\users\not_me\.conda\envs\quant\lib\site-packages (3.4.8)
Requirement already satisfied: pandas>=0.14 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (0.24.2)
Requirement already satisfied: pyOpenSSL in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (19.0.0)
Requirement already satisfied: inflection>=0.3.1 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (0.3.1)
Requirement already satisfied: numpy>=1.8 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (1.16.4)
Requirement already satisfied: more-itertools<=5.0.0 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (5.0.0)
Requirement already satisfied: pyasn1 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (0.4.5)
Requirement already satisfied: python-dateutil in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (2.8.0)
Requirement already satisfied: six in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (1.12.0)
Requirement already satisfied: ndg-httpsclient in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (0.5.1)
Requirement already satisfied: requests>=2.7.0 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from quandl) (2.22.0)
Requirement already satisfied: pytz>=2011k in c:\users\not_me\.conda\envs\quant\lib\site-packages (from pandas>=0.14->quandl) (2019.1)
Requirement already satisfied: cryptography>=2.3 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from pyOpenSSL->quandl) (2.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from requests>=2.7.0->quandl) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from requests>=2.7.0->quandl) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from requests>=2.7.0->quandl) (2019.6.16)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from requests>=2.7.0->quandl) (1.25.3)
Requirement already satisfied: asn1crypto>=0.21.0 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from cryptography>=2.3->pyOpenSSL->quandl) (0.24.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\users\not_me\.conda\envs\quant\lib\site-packages (from cryptography>=2.3->pyOpenSSL->quandl) (1.12.3)
Requirement already satisfied: pycparser in c:\users\not_me\.conda\envs\quant\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography>=2.3->pyOpenSSL->quandl) (2.19)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-614264e6071a> in <module>
      1 get_ipython().system('pip install quandl')
----> 3 import quandl

ModuleNotFoundError: No module named 'quandl'

4 Answers4

0

Try pip3 install quandl . It usually works for Python 3.x

0

Try installing it by running

!pip install quandl

In a cell in a Jupyter notebook. If you have things set up correctly, there's a chance that will be the same version of pip you need.

Edward Minnix
  • 2,889
  • 1
  • 13
  • 26
Arjunsai
  • 176
  • 1
  • 7
0

You can use pip using the module syntax rather than the standalone CLI for when you want to make sure you are using the version of pip associated with that interpreter.

python -m pip install quandl

Or, since you are using Conda, you could also try installing quandl with the conda CLI.

conda install quandl (or whatever the package's name is for conda).

Edward Minnix
  • 2,889
  • 1
  • 13
  • 26
0

The problem was that Jupyter was not properly recognizing my virtual environment. I found my answer here, the workaround is pretty self explanatory.