Solved

Python - ImportError: No module named 'urllib2'

Posted on 2016-09-01
2
530 Views
Last Modified: 2016-09-01
Hi there,

While running a Python script, I get the following error:
ImportError: No module named 'urllib2'

-Windows 8.1 pro
-Python 3.5.2
-Editor PyCharm 4.5.1

Can you please help me resolve this issue?

Thanks,
Rene
0
Comment
Question by:ReneGe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
TechieMD earned 500 total points
ID: 41780218
In python3, the urllib2 library was split over several modules. If you're trying to use urlopen try importing it from urllib.request:

from urllib.request import urlopen

Open in new window

0
 
LVL 10

Author Comment

by:ReneGe
ID: 41780240
Thanks mate :)

This seems to have resolve the issue

Cheers :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This article will show, step by step, how to integrate R code into a R Sweave document
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question