推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
sbmzhcn
V2EX  ›  Python

PycURL 💔 Windows & Python 64-bit #395

  •  
  •   sbmzhcn · Jul 29, 2016 · 2975 views
    This topic created in 3711 days ago, the information mentioned may be changed or developed.

    问题具体描述在 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 重新编绎 结果都失败,弄了一下午也搞不定。

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

    6 replies  •  2016-07-29 20:01:31 +08:00
    LeoQ
        1
    LeoQ  
       Jul 29, 2016 via iPhone
    我想你可以用 requests ,之类的库直接做请求....虽然没有直接回答你的问题,希望有帮助.
    neoblackcap
        2
    neoblackcap  
       Jul 29, 2016
    @LeoQ requests 会 block IOloop

    @sbmzhcn 不过为什么要上 pycurl ?因为 ssl?
    yangtukun1412
        3
    yangtukun1412  
       Jul 29, 2016
    看了下原 issue, 你是在 64 位 Python 里面 import 32 位 的 pyd?
    sbmzhcn
        4
    sbmzhcn  
    OP
       Jul 29, 2016
    @neoblackcap 默认的就是 pycurl, tornado 默认的使用就是它。我之前都没有安装过 pycurl.
    sbmzhcn
        5
    sbmzhcn  
    OP
       Jul 29, 2016
    我最后没办法了安装 python 32 位,解决了问题。
    SlipStupig
        6
    SlipStupig  
       Jul 29, 2016
    @sbmzhcn 那个 pycurl 要编译过需要 nss 或者 openssl 库支持和环境变量设置
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2596 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: f77a3b4c · 28ms · UTC 07:38 · PVG 15:38 · LAX 00:38 · JFK 03:38
    ♥ Do have faith in what you're doing.