问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/15763497/importerror-cannot-import-name-array-when-importing-urllib2