V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2017-10-08 21:34:07 +08:00 · 1785 次点击
    这是一个创建于 2395 天前的主题,其中的信息可能已经有所发展或是发生改变。

    自己写了一个统计历史天气的小程序,想以柱状图的方式展示结果,在终端运行正常。 现在想把它打包成桌面,同事也可以用,但是似乎 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)
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5336 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:36 · PVG 15:36 · LAX 00:36 · JFK 03:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.