Problem with the Requests package

Asked

Viewed 377 times

2

I am starting with Debian 8 and I am trying to run a code in Python, however, the error always appears:

No module named request.

I have checked several ways to try to fix, using Pip install ...

The requests package is installed

But the error remains... That’s the code:

*from scipy.interpolate import interp1d
import requests
from urllib2.request import urlopen
import matplotlib.pyplot as plt
import numpy as np
url = 'http://real-chart.finance.yahoo.com/table.csv?s=PETR4.SA&d=9&e=17&f=2015&g=d&a=0&b=3&c=2000&ignore=.csv'
petr_csv = urlopen(url)
data_petr = np.genfromtxt(petr_csv, delimiter=',', dtype=None)
# Dando uma olhada no cabecalho dos dados.
data_petr[0:4, 0:]*

1 answer

1

See if the package is really installed:

> pip show requests

Name: requests
Version: 2.16.4
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: [email protected]
License: Apache 2.0
Location: c:\program files\python35\lib\site-packages
Requires: certifi, chardet, urllib3, idna

Your code worked here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.