Asked  7 Months ago    Answers:  5   Viewed   57 times

Here's my code:

import urllib2.request

response = urllib2.urlopen("")
html =

Any help?



As stated in the urllib2 documentation:

The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

So you should instead be saying

from urllib.request import urlopen
html = urlopen("").read()

Your current, now-edited code sample is incorrect because you are saying urllib.urlopen("") instead of just urlopen("").

Tuesday, June 1, 2021
answered 7 Months ago

Support for Python 3 was added in NumPy version 1.5.0, so to begin with, you must download/install a newer version of NumPy.

Or simply using pip:

python3 -m pip install numpy
Thursday, June 3, 2021
answered 7 Months ago
22 returns an instance of bytes while StringIO is an in-memory stream for text only. Use BytesIO instead.

From What's new in Python 3.0 - Text Vs. Data Instead Of Unicode Vs. 8-bit

The StringIO and cStringIO modules are gone. Instead, import the io module and use io.StringIO or io.BytesIO for text and data respectively.

Monday, June 21, 2021
answered 6 Months ago

Try with lower case, import is case sensitive and it's as below:

import quandl

Did you install with pip? If so ensure quandl is among the listed installed modules with

pip list

Otherwise try


To make sure it was installed properly. If you don't see quandl listed , try to reinstall.

Tuesday, August 3, 2021
answered 5 Months ago

use the following to convert to a timestamp in python 2


Sunday, August 22, 2021
answered 4 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :