0

On a Windows computer with Anaconda installed, I tried to install the Quandl Python package by typing the following in the command line:

pip install Quandl

I get a confirmation "Successfully installed Quandl-2.8.9". Next, I would like to use Quandl. In a new Python script in Spyder try the following commands:

import Quandl
mydata=Quandl.get("FRED/GDP")

However, this yields the error message

AttributeError: module 'Quandl' has no attribute 'get'

I suspect that Quandl is somehow not installed properly. Is there some aspect of the installation I'm missing?

Kurt Peek
  • 52,165
  • 91
  • 301
  • 526

4 Answers4

3

As pointed out by kindall, I had inadvertently named the script "Quandl.py". I renamed it and the code works as expected.

Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
0

There are a couple of subtle changes and requirements. For example import statements should look like this.

import pandas as pd
import quandl

df = quandl.get('WIKI/GOOGL')

print(df.head())

And your script should be named Quandl.py with a capital Q.

Edison
  • 11,881
  • 5
  • 42
  • 50
0

As explained in your code you mentioned:

import Quandl
mydata=Quandl.get("FRED/GDP")

The correct import should be with small letter 'q'

import quandl
mydata=quandl.get("FRED/GDP")

And it worked for me

0

Renaming the python file name to Quandl.py worked for me.

Enayat
  • 3,904
  • 1
  • 33
  • 47