推荐学习书目
› 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
31nm
V2EX  ›  Python

PyInstaller 打包 Pygal 闪退问题

  •  
  •   31nm · Oct 8, 2017 · 2774 views
    This topic created in 3275 days ago, the information mentioned may be changed or developed.

    自己写了一个统计历史天气的小程序,想以柱状图的方式展示结果,在终端运行正常。 现在想把它打包成桌面,同事也可以用,但是似乎 PyInstaller 和 Pygal 兼容性不好,打包运行到 svg 渲染的模块就会闪退(我尝试把.render_to_file 的代码去掉,程序可以正常运行),请问各位大神有没有办法解决这个问题。

    def display_bars(result_dict, title, description):
        """Generate pygal bars for the result"""
    
        filename = title + '.svg'
        bar = pygal.Bar()
        bar.title = title
        bar.x_labels = [x for x in result_dict.keys()]
        bar.add(description, [x for x in result_dict.values()])
        # bar.render_to_file(filename)
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2500 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 04:40 · PVG 12:40 · LAX 21:40 · JFK 00:40
    ♥ Do have faith in what you're doing.