Solved

Python - ImportError: No module named 'urllib2'

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

830 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