2

I use Anaconda3 5.2.0 and jupyter notebook(python3)(Window10)

I made a file through 'pyinstaller'. But when I play file that I made, It has some Error.\

there are qwindows, qoffscreen, qminimal, qdirect2d .dall in platforms folder

============================================================================= qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized.

Reinstalling the application may fix this problem.

Available platform plugins are: minimal, offscreen, windows.

===========================================================================

The list that I tried

  1. conda update qt

  2. Copy Anaconda3\Library\plugins\platforms folder to Anaconda3

  3. reinstall Anaconda3

  4. reinstall PyQt5

Michal
  • 2,078
  • 23
  • 36
노견우
  • 21
  • 2

1 Answers1

1

I had a similar problem. With Anaconda, you need to bundle the platforms directory with your frozen application. I do it as follows:

def get_include_files():
    file_list = []
    d = os.path.abspath('C:\Anaconda2\envs\py3k\Library\plugins\platforms') #You need to change this
    file_list.append(d)
    #file_list.append('images')
    return file_list

Then in setup.py, just add these files as follows:

'build_exe': {
  'include_files': get_include_files()
 },
mr_js
  • 949
  • 12
  • 29
  • can you elaborate on your answer? I'm using PyInstaller to freeze my Python3 code. Where would I put the get_include_files function and where do I use build? – y4cine Jul 21 '19 at 05:52