2012-02-09 4 views
0

Windows 용 응용 프로그램을 고정하려고합니다. PyQt4를 사용하며 Python 2.7을 기반으로합니다. 모두는 내 PC에서만 컴파일하고 작동합니다. 여기 py2exe : UnicodeDecodeError (바이트 0xd1을 디코딩 할 수 없음)

from distutils.core import setup 
import py2exe, sys, os 
from glob import glob 
data_files = [('Microsoft.VC90.CRT', glob(r'..\Microsoft.VC90.CRT\*.*'))] 
sys.path.append(r'..\Microsoft.VC90.CRT') 
sys.argv.append('py2exe') 

py2exe_options = dict(
    includes=['sip', 
      'encodings', 
      'encodings.ascii', 
      'encodings.utf_8', 
      'encodings.cp866'], 
    excludes=['_ssl', 'pyreadline', 'difflib', 'doctest', 
    'tarfile', 'bz2', 'zipfile', 'optparse', 'pickle', 
    'pywin', 'pywin.debugger', 'pywin.debugger.dbgcon', 
    'pywin.dialogs', 'pywin.dialogs.list', 'calendar', 
    'Tkconstants', 'Tkinter', 'tcl', '_gtkagg', '_tkagg', 
    'bsddb', 'curses', 'email', 'Tkconstants', 'Tkinter'], 
    dll_excludes=['msvcp90.dll', 'msvcr90.dll', 'msvcm90.dll', 
    'libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 
    'tcl84.dll', 'tk84.dll'], 
    compressed=True 
) 

setup(
    name='Quirinus', 
    author='Dmitriy Selyutin', 
    author_email='[email protected]', 
    description='Quirinus: Dictionary', 
    version='0.1', 
    windows = \ 
    [ 
    { 
     'script': 'quirinus.py', 
     'icon_resources': [(0, 'icons/icon.ico')] 
    } 
    ], 
    options={'py2exe': py2exe_options}, 
    zipfile = None, 
    data_files = data_files 
) 

동결을 실행하는 명령입니다 : 여기
File "quirinus.py", line 4, in <module> 
File "zipextimporter.pyc", line 82, in load_module 
File "bin\core.pyc", line 17, in <module> 
File "bin\xstring.pyc", line 19, in str2unicode 
File "encodings\utf_8.pyc", line 16, in decode 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 3: invalid continuation byte 

내 setup.py의 코드입니다 : 다른 PC에있는 오류가 발생, 파이썬이 설치되어 있지 않습니다

# coding: UTF-8 
,536,913,632 : python.exe .\setup.py py2exe -b 1

내 프로젝트의 모든 소스 파일은 처음에 "인코딩"라인을 가지고 10

유니 코드가 잘 작동하도록 모든 것을 다했다고 생각합니다. 그리고 그것은 파이썬이있는 모든 컴퓨터에서 작동합니다. :-)하지만 컴퓨터에 파이썬이 없으면 응용 프로그램이 실패합니다. 누구든지이 문제가 발생 했습니까?

P. 또한 PyInstaller (python.exe .\pyinstaller.py -F -w)를 사용하여 고정하려고했으나 고정 된 응용 프로그램이 실행되지 않습니다. 그리고 네, 근원에있는 모든 문자열은 다음 형식을 갖습니다 : u'string '.

답변

0

다른 PC에 파이썬이 설치되어 있는지 여부와 관련이 없다고 생각합니다. 나는 당신이 당신의 사양과 비교하여 다른 PC에 프로세서 사양이 무엇인지 재검토해야한다고 생각한다.

프리즈는 매우 프로세서마다 다를 수 있으므로 크로스 프로세서 호환성에 문제가있을 수 있습니다.

+0

당신은 아름다운 말을했습니다. 내 코드가 완전히 깨끗한 가상 Windows 7에서 작동한다는 것을 이해했지만 일반적인 Windows Vista에서는 작동하지 않습니다. – ghostmansd

+0

귀하의 의견을 이해할 수 없습니다. 이 질문에 대한 도움이 필요하거나 적절하게 답변 해 주셨습니까? – inspectorG4dget

+0

질문을 풀지 않습니다. 나는 무엇을해야만 하는가? 모든 버전의 Windows에서 응용 프로그램을 일시 중지 하시겠습니까? 나는 네가 옳았다는 것을 내가 알았다고 만 말했어. 그러나 그것을 해결할 수 있습니까? 그렇다면 어떻게? 모든 Windows 버전에서 바이너리를 다시 고정합니까? – ghostmansd