Problem with the Requests package

2

I'm starting with Debian 8 and I'm trying to run a code in Python, but the error always appears:

  

No module named request.

I have already checked several ways to try to fix using pip install ...

The requests package is installed

But the error continues ... The code is this:

*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:]*
    
asked by anonymous 28.05.2017 / 20:11

1 answer

1

See if the package is even 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.

    
28.05.2017 / 20:49