Solved

Python - ImportError: No module named 'urllib2'

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

896 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

15 Experts available now in Live!

Get 1:1 Help Now