Solved

Python - ImportError: No module named 'urllib2'

Posted on 2016-09-01
2
105 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
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now