Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name array, when importing urllib2

I am getting below error when trying to import the urllib2:

>>> import urllib2

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/urllib2.py", line 94, in <module>
import httplib
File "/usr/lib64/python2.7/httplib.py", line 69, in <module>
from array import array

ImportError: cannot import name array`

Any thoughts on it?

like image 800
S R Avatar asked Feb 17 '23 23:02

S R


1 Answers

It seems you have a python program named "array.py" in you present working directory. If yes rename that python program or move it to some other directory.

like image 182
Ramesh Raithatha Avatar answered Apr 28 '23 00:04

Ramesh Raithatha