1

I know there are many posts about this problem (i've read them all). But i still have a problem with my exe, still cannot be opened.

I've tried to put the qwindows.dll (i tried with 3 different qwindows.dll) in the folder dist with my exe but doesn't change anyhting.

I've tried with libEGL.dll, nothing.

Any suggestions ? Is there a way to avoid having this problem ?

guy16
  • 233
  • 2
  • 3
  • 16
  • 2
    Please explain your problem in a more elaborate way. That is, when does this problem appear, what are you trying to achieve, what all methods have you tried to fix it etc. – Vikas Ojha Jun 10 '15 at 13:26

3 Answers3

3

I've had this issue aswell, after a lot of digging I found the following solution:

Copy the following file next to you main .exe: libEGL.dll

Copy the following file in a folder "platforms" next to you main .exe: qwindows.dll

Putting the qwindows.dll in the subfolder is the important part I think, hope this helps

Inktvisje
  • 46
  • 3
  • This works (I copied the folders _platforms_ , _plugins_ and _translations_ from PyQt5 in the main .exe folder just to be sure) – guy16 Jul 27 '15 at 07:28
  • Awesome... I wish I could up-vote this multiple times. :) – Jed Nov 16 '17 at 23:38
2

Try:

from setuptools import setup
import platform
from glob import glob
from main import __version__, __appname__, __author__, __author_email__


SETUP_DICT = {

    'name': __appname__,
    'version': __version__,
    'description': 'description',
    'author': __author__,
    'author_email': __author_email__,

    'data_files': (
        ('', glob(r'C:\Windows\SYSTEM32\msvcp100.dll')),
        ('', glob(r'C:\Windows\SYSTEM32\msvcr100.dll')),
        ('platforms', glob(r'C:\Python34\Lib\site-packages\PyQt5\plugins\platforms\qwindows.dll')),
        ('images', ['images\logo.png']),
        ('images', ['images\shannon.png']),
    ),

    'options': {
        'py2exe': {
            'bundle_files': 1,
            'includes': ['sip', 'PyQt5.QtCore'],
        },
    }
}

if platform.system() == 'Windows':
    import py2exe
    SETUP_DICT['windows'] = [{
        'script': 'main.py',
        'icon_resources': [(0, r'images\logo.ico')]
    }]
    SETUP_DICT['zipfile'] = None

setup(**SETUP_DICT)

copy the dependency manually is a bad way to do, because py2exe take care of it. With pyqt5, this setup works, BUT if I try in other computer without pyqt install the exe crashes. I migrated to pyqt4 and run in all computers.

Reinier Hernández
  • 428
  • 1
  • 6
  • 22
0

For me it was enough to copy qwindows.dll to platforms folder, like @Inktvisje wrote.

And don't repeat my mistake: don't download this dll from Internet! Copy it from your Python libs folder: YourPythonFolder\Lib\site-packages\PyQt5\plugins\platforms.

DimaSan
  • 12,264
  • 11
  • 65
  • 75