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

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

從 GitHub (urllib.request) 下載 csv 文件時(shí)出錯(cuò)

從 GitHub (urllib.request) 下載 csv 文件時(shí)出錯(cuò)

瀟瀟雨雨 2023-06-13 10:43:24
我已經(jīng)研究這個(gè)腳本幾個(gè)星期了,我剛剛完成,一切都運(yùn)行良好。我返回腳本并嘗試運(yùn)行它,但我遇到了一個(gè)錯(cuò)誤并且知道它的含義以及如何解決它。當(dāng)我下載一些包含 CoronaVirus 數(shù)據(jù)的 csv 文件時(shí),腳本很早就出現(xiàn)了錯(cuò)誤。我正在使用 urllib.request 來(lái)執(zhí)行此操作,但出現(xiàn)錯(cuò)誤  File "Run.py", line 13, in <module>    urllib.request.urlretrieve(url, filename="time_series_covid19_recoveredGlobal.csv")  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 247, in urlretrieve    with contextlib.closing(urlopen(url, data)) as fp:  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen    return opener.open(url, data, timeout)  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open    response = self._open(req, data)  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open    result = self._call_chain(self.handle_open, protocol, protocol +  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain    result = func(*args)  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1362, in https_open    return self.do_open(http.client.HTTPSConnection, req,  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1322, in do_open    raise URLError(err)urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
查看完整描述

1 回答

?
Smart貓小萌

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

您的網(wǎng)址有拼寫(xiě)錯(cuò)誤:


而不是域是githubuserxxxent.com,他們應(yīng)該是githubusercontent.com。


請(qǐng)注意,嘗試在瀏覽器中訪問(wèn)它時(shí)githubuserxxxent.com會(huì)返回錯(cuò)誤。Address not found


也許您在代碼中進(jìn)行了查找和替換,這就是發(fā)生這種情況的原因。


固定代碼:


import urllib.request

url = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv"

urllib.request.urlretrieve(url, filename="time_series_covid19_recoveredGlobal.csv")

url = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"

urllib.request.urlretrieve(url, filename="time_series_covid19_confirmed_global.csv")

url = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv"

urllib.request.urlretrieve(url, filename="time_series_covid19_deaths_global.csv")



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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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