2011-01-18 6 views
0

내 응용 프로그램에서 QGraphicsPixmapItem을 사용하고 'dist'디렉토리의 'imageformats'하위 디렉토리에 qjpeg4.dll을 놓은 jpeg 파일을로드 할 수있게합니다.
'bundle_files'옵션이 3으로 설정된 경우에만 작동합니다.
1 또는 2로 설정하면 qt4 (pyqt4)가 더 이상 필요한 dll을 찾을 수 없어 QGraphicsPixmapItems가 표시되지 않습니다.py2exe bundle_files = 1 또는 2가 실패했습니다.

setup.py :

from distutils.core import setup 
import py2exe 

setup(
    options = {'py2exe': {'bundle_files': 1}}, 
    description = "", 
    name = "name", 
    windows = ["mainwindow.py"], 
    zipfile=None, 
    ) 

답변

0

당신은 사용하여 DLL을 포함 py2exe에 설득 할 수 있어야한다 : (AFAIK) 나중에 참조 할 수 있도록

setup(
     # other options, 
     data_files=[('imageformats', 'qjpeg4.dll'), 
     #other options 
    ) 

, data_files는 다음과 같이한다을 :

data_files = [ (dir1, [file1, file2, ...]), (dir2, [file3, file4, ...]), ...]

편집 1 :

  • [qt.conf] (선택

    • yourapp.exe :이 같은 디렉토리 구조 (source)를 사용하여 시도 할 수 있을까?
    • 플러그인/
      • imageformats/
        • qjpeg4.dll

    그리고 문제가 해결되지 않으면, here은을 사용하여 제안) 낮은 아래 참조 qt.conf 파일은 다음과 같습니다 :

    (그것은 당신의 qt.conf 파일을 해석이 .DLL을 필요로) 분명히 핵심 DLL QtCore4.dll로 잘 너무 오래 작동합니다
    [Paths] 
    Plugins = <directory containing the imageformats directory> 
    

    이 제대로 포함되었습니다.

  • +0

    복제본 – ras

    +0

    나는 py2exe가 data_files를 사용하여 dist/imageformats 디렉토리에 자동으로 dll을 추가하도록 설득 할 수있었습니다. 슬프게도 qt4는 어쨌든 그것을 보지 못합니다. – ras

    +0

    오류 메시지를 게시 할 수 있습니까? – William