Problem compiling python in pyqt libraries, with py2exe

1

I'm trying to compile with py2exe , but when I'll compile from the error.

I will give an example of this error, with the programs Python 2.7 64 bits, pyqt4 for Python 2.7, and py2exe for Python 2.7.

Follow the example:

Create a file teste.py with body:

import sys  
from PyQt4 import QtGui, uic

Create a setup.py file with body:

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

Then compile:

python setup.py py2exe

And the error occurs:

error: compiling
'C:\Python27\lib\site-packages\PyQt4\uic\port_v3\proxy_base.py' failed
SyntaxError: invalid syntax <proxy_base.py, line 26>
    
asked by anonymous 03.02.2016 / 01:24

1 answer

1

According to information from this site:
PyQt 4.7 and py2exe error

There is a recommendation to remove (or temporarily move to some other location) the port_v3 directory, which in your question is in the path:

C:\Python27\lib\site-packages\PyQt4\uic\port_v3

In this other site:
PyQt4 compiling issues

There is a recommendation to, in addition to removing the port_v3 folder, use the following command to generate the executable:

python "setup.py py2exe --includes sip"

A suggestion: Before you remove the folder, you can try the above command to generate the executable, and if it does not work, then try removing the folder and generating it again (with the complete command, including sip ). .

    
03.02.2016 / 01:56