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
borischenc
V2EX  ›  Python

Python 编辑 Mac 可执行文件 py2app 可以创建 console application 吗?

  •  
  •   borischenc · 2017-03-29 20:01:15 +08:00 · 3073 次点击
    这是一个创建于 2578 天前的主题,其中的信息可能已经有所发展或是发生改变。

    似乎在 windows 上面是可以的,但是 Mac 上面直接套用 windows 的 setup.py 就会出错

    setup.py(windows):

    
    from distutils.core import setup  
    import py2exe  
      
    setup(console=['sakai_getter.py'])  
    

    请问具体有什么办法可以在 Mac 上面也编译出 console application 吗?

    4 条回复    2017-03-29 21:09:39 +08:00
    konia
        1
    konia  
       2017-03-29 20:29:06 +08:00 via iPhone
    试过 pyinstaller 吗
    borischenc
        2
    borischenc  
    OP
       2017-03-29 20:46:58 +08:00
    @konia
    pyinstaller 编译出来的文件执行的时候会说 ImportError: No module named 'queue'
    不是很清楚为什么
    使用的 python3.5 编写的程序
    Kilerd
        3
    Kilerd  
       2017-03-29 21:04:24 +08:00
    @borischenc 你没把库也一起打包进去把?
    borischenc
        4
    borischenc  
    OP
       2017-03-29 21:09:39 +08:00
    @Kilerd 请问要怎么打包进去呢?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2969 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:16 · PVG 08:16 · LAX 17:16 · JFK 20:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.