久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

FTPLIB 錯誤 socket.gaierror: [Errno 8] nodename nor servnam

FTPLIB error socket.gaierror: [Errno 8] nodename nor servname provided, or not known(FTPLIB 錯誤 socket.gaierror: [Errno 8] nodename nor servname provided, or not known)
本文介紹了FTPLIB 錯誤 socket.gaierror: [Errno 8] nodename nor servname provided, or not known的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試使用 FTPlib 從 FTP 服務(wù)器下載文件,但我不斷收到以下錯誤消息.我嘗試了在 SO 上找到的幾種方法,即編輯 etc/host 文件并在本地主機 IP 后添加計算機名稱,但這也不起作用.

I'm trying to download a file from an FTP server using FTPlib but i keep getting the error below. I tried several methods found on SO namely editing the etc/host file and adding the computer name after the local host IP but that doesnt work either.

非常感謝任何幫助.(運行mac,python 3.7,macOS Mojave 10.14.2)

Any help is much appreciated. (running a mac, python 3.7, macOS Mojave 10.14.2)

我正在嘗試運行的代碼:

from ftplib import FTP

ftp = FTP('myftpurl')

錯誤:

Traceback (most recent call last):

文件",第 1 行,在init 中的文件/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ftplib.py",第 117 行self.connect(主機)文件/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ftplib.py",第 152 行,在連接中source_address=self.source_address)文件/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py",第 707 行,在 create_connection對于 getaddrinfo(host, port, 0, SOCK_STREAM) 中的 res:文件/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py",第 748 行,在 getaddrinfo對于 _socket.getaddrinfo 中的 res(主機、端口、家庭、類型、原型、標(biāo)志):socket.gaierror: [Errno 8] nodename or servname provided, or not known

File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ftplib.py", line 117, in init self.connect(host) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ftplib.py", line 152, in connect source_address=self.source_address) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 707, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 8] nodename nor servname provided, or not known

推薦答案

ftp = FTP('myftpurl')

不清楚 myftpurl 在您的特定代碼中實際包含什么.
但鑒于它的名稱,我假設(shè)您已經(jīng)嘗試過類似 ftp://example.com 的方法.僅作為 明確記錄 FTP(...) 不需要 URL,而是主機名或 IP,即 FTP('example.com') 而不是 FTP('ftp://example.com').

It is not clear what myftpurl actually contains in your specific code.
But given its name I assume that you've tried something like ftp://example.com. Only, as clearly documented FTP(...) does not expect a URL but instead a hostname or IP, i.e. FTP('example.com') and not FTP('ftp://example.com').

給定一個 URL,就像你可能做的那樣,將導(dǎo)致將該 URL 視為主機名,即查找主機名 ftp://example.com.由于這樣的主機不存在,您會收到錯誤消息.

Given a URL like you probably do will result in treating that URL as hostname, i.e. doing a lookup for the hostname ftp://example.com. Since such a host does not exist you get an error.

這篇關(guān)于FTPLIB 錯誤 socket.gaierror: [Errno 8] nodename nor servname provided, or not known的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Why I cannot make an insert to Python list?(為什么我不能插入 Python 列表?)
Insert a column at the beginning (leftmost end) of a DataFrame(在 DataFrame 的開頭(最左端)插入一列)
Python psycopg2 not inserting into postgresql table(Python psycopg2 沒有插入到 postgresql 表中)
list extend() to index, inserting list elements not only to the end(list extend() 索引,不僅將列表元素插入到末尾)
How to add element in Python to the end of list using list.insert?(如何使用 list.insert 將 Python 中的元素添加到列表末尾?)
TypeError: #39;float#39; object is not subscriptable(TypeError:“浮動對象不可下標(biāo))
主站蜘蛛池模板: 久久亚洲国产精品日日av夜夜 | 最近中文字幕第一页 | 午夜影院在线观看视频 | 精品一区久久 | 狠狠骚 | 伦理午夜电影免费观看 | 91久久综合 | 成人a免费| 做a视频在线观看 | 中文字幕在线观看视频一区 | 国产乱码一二三区精品 | 中文字幕日韩欧美一区二区三区 | 在线观看亚洲欧美 | av性色| 精品综合久久 | 精品视频99 | 久久国内精品 | 99精品国产一区二区三区 | 国产三区视频在线观看 | 五月婷婷激情网 | 91伊人 | 91精品国产91久久综合桃花 | 蜜桃综合在线 | 久久精品免费一区二区三 | 天天狠狠 | 亚洲午夜精品一区二区三区他趣 | av色站| 国产一区二区三区视频 | 91视频电影 | 免费国产一区二区 | 久久久久亚洲精品 | 欧美日韩久 | 中文字幕视频网 | 午夜一级做a爰片久久毛片 精品综合 | 久久一二区 | 国产精品久久久久免费 | 欧美一区二区三区 | 青青久草 | av一区二区三区四区 | 日韩精品一区二区三区在线观看 | 国产亚洲精品一区二区三区 |