Quandl is not being imported - python

I'm getting started for Machine learning using Python and would like to use Quandl for computing. I installed the Quandl using pip install Quandl and also, pandas using pip install pandas. Later, the import for pandas is successful, but, I couldn't import quandl. I get error as following,
`ImportError: No module named Quandl`
I use Python 2.7 and Quandl supports both 2 and 3 version of Python. How to do the import properly ?

Looking at the docs, it is lower case:
import quandl

Related

ModuleNotFoundError: No module named 'pycountry' even though it is installed

I got this error from python ModuleNotFoundError: No module named 'pycountry'.
I imported the module using pip and pip3 and I've also tried running my code in terminal using python, python3, and IDLE.
Why doesn't python recognize the module? I'm receiving the same error about plotly and pandas as well.
import pycountry
import plotly.express as px
import pandas as pd
URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csvā€© '
df1 = pd.read_csv(URL_DATASET)
list_countries = df1['Country'].unique().tolist()
d_country_code = {}
Open your command window and then use this code there.
pip install pycountry
This will install the whole package in your system, so whenever you import the module, it will not show an error.
This worked for me, I was facing the same issue while using it in Jupyter Notebook.
If you want more information please visit this page.
If you have Anaconda, try:
conda install -c conda-forge pycountry

importing wrong module in script

I am trying to import this module, exactly as per the documentation
from pytrends.request import TrendReq
I get the below error. It's trying to import the requests module, not pytrends.request
How can I get around this?
ModuleNotFoundError: No module named 'requests.packages.urllib3.util.retry'; 'requests.packages.urllib3.util' is not a package
First,
pip install requests lxml pandas
Also, make sure that you have installed pytrends as the comment suggests.
pip install pytrends
Also, make sure there no conflicts between conda and your default ecosystem.

How can I import pandas correctly in python script via Rstudio

I just failed to import pandas in python script via Rstudio and it also failed to install pandas by pip. I would appreciate it if you can tell the right way to import pandas. Thanks!
import pandas as pd
> reticulate::repl_python()
Python 2.7.10 (/usr/bin/python)
Reticulate 1.12 REPL -- A Python interpreter in R.
>>> import pandas as pd
ImportError: No module named pandas
>>>
or install pandas in the terminal:
$ pip install pandas
it still showed the ImportError

Why am I unable to import the gensim module that has definitely been installed?

I have installed the gensim module for MAC by passing the following command in my Terminal:
pip3 install gensim
I already have many other modules such as pandas and numpy that have been installed but I am able to import the same to my Jupyter Notebook without any issues.
This is how I am importing gensim:
from gensim.models import Word2Vec
from gensim.models import KeyedVectors
So I checked the path where the 2 modules have been installed through the terminal, these being the same for a module I am able to import such as pandas as well as for gensim.
pip3 show pandas
pip3 show gensim
In both the cases I get the same output:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
Can anyone tell me what could be the issue in this case?

ImportError: No module named pandas. Pandas installed

I am pretty new to programming and am having issues importing pandas to my program. Hoping someone could point me in the right direction to fix this. I am running OSX
regresson.py
import pandas as pd
import Quandl
df = Quandl.get('WIKI/GOOGL')
print df.head
and am getting the error:
import pandas as pd
ImportError: No module named panda
I have anaconda on my system.
Pandas 0.17.1
Numpy 1.11.1
Scipy 0.18.0
Pytz 2016.6.1
make sure to activate your conda environment
in your terminal-
conda create -n environment_name quandl pandas
cd path_to_env
activate environment_name
(environment_name)conda list (make sure u have the right packages)
(environment_name) your_program.py
# if using pip
pip install pandas
# if using anaconda
conda install pandas
#after this step use
condo update -all
Python imports, and the language itself, is case sensitive. This means that after you fix the pandas installation, you'll also need
import quandl
and not
import Quandl
On another note, it's worth noting that we usually call df.head(), not df.head. This way, when working on a Jupyter notebook, as an example, the formatting is nicer. Also you can specify the number of first rows you want to see, such as df.head(10).

Categories

Resources