pyinstaller 打包ppcls(conda环境下)

  1. 代码修改:在 conda 环境下

\envs\paddle_class\Lib\sitepackages\paddle\dataset\image.py

作一下修该:

if six.PY3:
    import subprocess
    import sys
    import os
    interpreter = sys.executable
    # Note(zhouwei): if use Python/C 'PyRun_SimpleString', 'sys.executable'
    # will be the C++ execubable on Windows
    # if sys.platform == 'win32' and 'python.exe' not in interpreter:
    #     interpreter = sys.exec_prefix + os.sep + 'python.exe'
    # import_cv2_proc = subprocess.Popen(
    #     [interpreter, "-c", "import cv2"],
    #     stdout=subprocess.PIPE,
    #     stderr=subprocess.PIPE)
    # out, err = import_cv2_proc.communicate()
    # retcode = import_cv2_proc.poll()
    # if retcode != 0:
    #     cv2 = None
    # else:
    #     import cv2
    try:
        import cv2
    except ImportError:
        cv2 = None
else:
    try:
        import cv2
    except ImportError
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值