Python - Trouble in building executable

后端 未结 4 1930
别跟我提以往
别跟我提以往 2020-12-03 18:36

I\'m a python programmer and I\'m trying to build an executable binary to distribute my software to my clients, even if it\'s not fully executable I want to be able to distr

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 19:26

    I was at this all day and found a workaround, it's sneaky but it works. In the error message I was receiving I noticed that there was a space between in library .zip. I could not trace it down in the source code for py2exe or selenium. I too had tried putting the xpi file in the library zip and it did not work. The workaround is:

    1. In your setup file use these options:

      setup(
          console=['yourFile.py'],
          options={
                  "py2exe":{
                          "skip_archive": True,
                          "unbuffered": True,
                          "optimize": 2
                  }
          }
      )
      
    2. Run the py2exe install

    3. Copy the xpi file into the dist directory

    That should do it.

提交回复
热议问题