小编RR1*_*RR1的帖子

(python) [Errno 11001] getaddrinfo 失败

有人可以帮助我了解如何捕获此错误吗?

import pygeoip  
gi = pygeoip.GeoIP('GeoIP.dat')  
print gi.country_code_by_name('specificdownload.com')  

Traceback (most recent call last):  
  File "<module1>", line 14, in <module>  
  File "build\bdist.win-amd64\egg\pygeoip\__init__.py", line 447, in country_code_by_name  
    addr = self._gethostbyname(hostname)  
  File "build\bdist.win-amd64\egg\pygeoip\__init__.py", line 392, in _gethostbyname  
    return socket.gethostbyname(hostname)  
gaierror: [Errno 11001] getaddrinfo failed 
Run Code Online (Sandbox Code Playgroud)

python getaddrinfo

4
推荐指数
1
解决办法
7万
查看次数

在 ubuntu 16.04 上安装 Mongo C 驱动程序时出现问题

我已经使用以下命令在 ubuntu 16.04 上安装了 Mongo C 驱动程序:

sudo apt-get install libmongoc-1.0-0


当我尝试使用 cmake 进行编译时,出现以下错误:

rolf@ubuntu2:~/src/test$ cmake .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX …
Run Code Online (Sandbox Code Playgroud)

mongo-c-driver ubuntu-16.04

1
推荐指数
1
解决办法
3103
查看次数