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?

4

4 回答 4

3

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

于 2016-04-17T21:38:07.060 回答
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.

于 2016-09-25T19:16:35.953 回答
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

于 2017-01-02T18:25:04.883 回答
0

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

于 2018-01-04T13:25:13.017 回答