1
CODE:NameError:名称 '的urllib' 没有定义“
import networkx as net
from urllib.request import urlopen
def read_lj_friends(g, name):
# fetch the friend-list from LiveJournal
response=urllib.urlopen('http://www.livejournal.com/misc/fdata.bml?user='+name)
错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'urllib' is not defined
'urllib'是标准库的一部分。你不需要安装'urllib3'这是一个不同的库。另外,'urlopen'返回一个类似文件的对象,而不是html。 – interjay
复杂,抱歉。我正在修复它。感谢您的警告。 –