zoukankan      html  css  js  c++  java
  • cx_freeze安装使用

    在windows下 安装比较方便又专门的安装包

    然后cmd 进入 c:python33Scripts

    >cxfreeze E:main.py --target-dir E:

    前面是源文件,如果有多个文件的话就是主程序在的文件,最后一个是生成程序的目录

    在linux下 下载cx_freeze的源码后解压,

    进入cx_Freeze-4.3.4

    输入 sudo python3 setup.py build  # 因为我用的是python3.4版本所以用python3 而且需要先安装python3.4的dev

    这编译出错

    build/temp.linux-x86_64-2.7/source/bases/Console.o:在函数‘GetImporterHelper’中:
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Common.c:211:对‘PyObject_CallMethod’未定义的引用
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Common.c:215:对‘PyErr_Clear’未定义的引用
    build/temp.linux-x86_64-2.7/source/bases/Console.o:在函数‘GetDirName’中:
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Common.c:66:对‘PyString_FromStringAndSize’未定义的引用
    build/temp.linux-x86_64-2.7/source/bases/Console.o:在函数‘FatalError’中:
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Console.c:24:对‘PyErr_Print’未定义的引用
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Console.c:25:对‘Py_FatalError’未定义的引用
    build/temp.linux-x86_64-2.7/source/bases/Console.o:在函数‘SetExecutableName’中:
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Common.c:93:对‘PyString_FromString’未定义的引用
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Common.c:115:对‘PyString_FromStringAndSize’未定义的引用
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Common.c:136:对‘PyString_FromString’未定义的引用
    build/temp.linux-x86_64-2.7/source/bases/Console.o:在函数‘FatalError’中:
    /home/bill/Downloads/cx_Freeze-4.3.3/source/bases/Console.c:24:对‘PyErr_Print’未定义的引用

    。。。。

    查了一下 网上有修改setup.py  将其中的if not vars.get("Py_ENABLE_SHARED", 0): 修改成 if True:

    就可以了

    最后 sudo python3 setup.py install

    完成

    用法 是 终端下 cxfreeze ~main.py --target-dir ~

  • 相关阅读:
    06 is和==的区别 encode()编码 decode()解码
    05 dic的增删改查 字典的嵌套 考试题dic.get()的相关使用
    03 编码 int ,bool,str的常用操作 主要讲str
    01 基本数据类型 变量 if语句
    04 列表的增删改查 常用方法 元祖 range
    02 while循环 格式化输出 运算符
    多校2 Harmonious Army hdu6598 网络流
    P3159 [CQOI2012]交换棋子 网络流
    P2172 [国家集训队]部落战争 最大流
    P2402 奶牛隐藏 网络流
  • 原文地址:https://www.cnblogs.com/yemeng/p/5132053.html
Copyright © 2011-2022 走看看