我无法通过运行 “python startup.py” 来下载 “enron_mail_20150507.tar.gz”。我遇到了以下错误,并且不知道如何解决。
downloading the Enron dataset (this may take a while) to check on progress, you can cd up one level, then execute <ls -lthr> Enron dataset should be last item on the list, along with its current size download will complete at about 423 MB Traceback (most recent call last): File "startup.py", line 36, in urllib.urlretrieve(url, filename="../enron_mail_20150507.tar.gz") File "C:\Python27\lib\urllib.py", line 98, in urlretrieve return opener.retrieve(url, filename, reporthook, data) File "C:\Python27\lib\urllib.py", line 245, in retrieve fp = self.open(url, data) File "C:\Python27\lib\urllib.py", line 213, in open return getattr(self, name)(url) File "C:\Python27\lib\urllib.py", line 350, in open_http h.endheaders(data) File "C:\Python27\lib\httplib.py", line 1049, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 893, in _send_output self.send(msg) File "C:\Python27\lib\httplib.py", line 855, in send self.connect() File "C:\Python27\lib\httplib.py", line 832, in connect self.timeout, self.source_address) File "C:\Python27\lib\socket.py", line 557, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 11001] getaddrinfo failed
我尝试在 “startup.py” 中更改了 URL 为 ” http://www.cs.cmu.edu/~enron/enron_mail_20150507.tar.gz“,但还是不行。如果有人在 Windows 上使用 Python 成功下载了这个文件,请告诉我方法。我非常感激。
无论如何,我尝试手动下载,但文件在下载了 1.1 GB 后还在继续下载,所以我害怕了就停止了…哈哈 XD。”enron_mail_20150507.tar.gz” 文件有多大?下载后我应该把它放在哪里?在 ud120-projects 里吗?
请帮助我。我卡住了。
回答:
问题已经解决。我通过 starup.py 中的链接手动下载了文件,文件大小为 1.69 GB(压缩后)和 2.23 GB(解压后)。