PycURL 💔 Windows & Python 64-bit #395

2016-07-29 10:11:19 +08:00
 sbmzhcn

问题具体描述在 https://github.com/tornadoweb/tornado/issues/1660 只要添加这一句

import tornado.ioloop
import tornado.httpclient

tornado.httpclient.AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
http_client = tornado.httpclient.AsyncHTTPClient()

def done(r):
    print "done!", r

response = http_client.fetch("https://google.com", done)

tornado.ioloop.IOLoop.instance().start()

上面的代码只要添加这一句

tornado.httpclient.AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")

程序就会退出。 说是因为 libcurl 的问题,我下载了 pycurl, libcurl 重新编绎 结果都失败,弄了一下午也搞不定。

有谁曾经遇到这个问题,已经解决的,给个方便的办法。

2158 次点击
所在节点    Python
6 条回复
LeoQ
2016-07-29 11:01:30 +08:00
我想你可以用 requests ,之类的库直接做请求....虽然没有直接回答你的问题,希望有帮助.
neoblackcap
2016-07-29 11:40:14 +08:00
@LeoQ requests 会 block IOloop

@sbmzhcn 不过为什么要上 pycurl ?因为 ssl?
yangtukun1412
2016-07-29 11:48:01 +08:00
看了下原 issue, 你是在 64 位 Python 里面 import 32 位 的 pyd?
sbmzhcn
2016-07-29 17:01:27 +08:00
@neoblackcap 默认的就是 pycurl, tornado 默认的使用就是它。我之前都没有安装过 pycurl.
sbmzhcn
2016-07-29 17:05:05 +08:00
我最后没办法了安装 python 32 位,解决了问题。
SlipStupig
2016-07-29 20:01:31 +08:00
@sbmzhcn 那个 pycurl 要编译过需要 nss 或者 openssl 库支持和环境变量设置

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/295692

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX