pyinstaller打包程序报错的解决办法


错误一:upx is not available

原因是由于subprocess.py程序被改动过,解决办法是将其中Popen类的初始化函数的shell参数默认值改为False即可,upx貌似是一种脱壳程序,打包的时候需要用Popen调用upx。

class Popen(object):
    """ Execute a child program in a new process.

    ...

    Attributes:
        stdin, stdout, stderr, pid, returncode
    """
    _child_created = False  # Set here since __del__ checks it

    def __init__(self, args, bufsize=-1, executable=None,
                 stdin=None, stdout=None, stderr=None,
                 preexec_fn=None, close_fds=_PLATFORM_DEFAULT_CLOSE_FDS,
                 shell=False, cwd=None, env=None, universal_newlines=False,
                 startupinfo=None, creationflags=0,
                 restore_signals=True, start_new_session=False,
                 pass_fds=(), *, encoding=None, errors=None):

错误二:LINK : fatal error LNK1158: cannot run 'rc.exe'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158

原因是vc安装目录下缺少两个文件,解决办法就是

从路径 C:\Program Files (x86)\Windows Kits\8.1\bin\x86复制

rc.exe  rcdll.dll 

两个文件

到路径C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM