第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Python urllib 屬性錯(cuò)誤

Python urllib 屬性錯(cuò)誤

莫回?zé)o 2023-04-18 14:48:54
import urllib.requestfhand = urllib.request.urlopen("http://www.python.org")for line in fhand:        print(line.decode().strip())這段代碼不起作用,我在 windows10 上使用 python3。每次我使用原子編輯器在命令提示符下運(yùn)行此代碼時(shí),都會(huì)收到以下錯(cuò)誤消息:Traceback (most recent call last):  File "C:\Users\isha\Downloads\py4e\trial.py", line 1, in <module>    import urllib.request  File "C:\Users\isha\AppData\Local\Programs\Python\Python38-32\lib\urllib\request.py", line 88, in <module>    import http.client  File "C:\Users\isha\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 71, in <module>    import email.parser  File "C:\Users\isha\AppData\Local\Programs\Python\Python38-32\lib\email\parser.py", line 12, in <module>    from email.feedparser import FeedParser, BytesFeedParser  File "C:\Users\isha\AppData\Local\Programs\Python\Python38-32\lib\email\feedparser.py", line 27, in <module>    from email._policybase import compat32  File "C:\Users\isha\AppData\Local\Programs\Python\Python38-32\lib\email\_policybase.py", line 9, in <module>    from email.utils import _has_surrogates  File "C:\Users\isha\AppData\Local\Programs\Python\Python38-32\lib\email\utils.py", line 29, in <module>    import socket  File "C:\Users\isha\Downloads\py4e\socket.py", line 5, in <module>    mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)**AttributeError: partially initialized module 'socket' has no attribute 'AF_INET' (most likely due to a circular import)**幫助我處理這段代碼,我也無(wú)法運(yùn)行urllib.request相關(guān)程序
查看完整描述

1 回答

?
慕的地8271018

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個(gè)贊

您的代碼對(duì)我來(lái)說(shuō)效果很好。嘗試刪除 'C:\Users\isha\Downloads\py4e\socket.py' 這個(gè)文件并再次運(yùn)行你的代碼。



查看完整回答
反對(duì) 回復(fù) 2023-04-18
  • 1 回答
  • 0 關(guān)注
  • 155 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)