我正在尝试使用PyInstaller将Python包装器放在导入Python包python-arabic-reshaper的Python 2.7脚本中,该脚本在单独运行时工作正常,但如果在Pyinstaller中运行则以下面的错误结束EXE。
配置文件是default-config.ini,并且已安装configparser软件包。
代码:
import sys
from arabic_reshaper import ArabicReshaper
config1={
'delete_harakat':False,
'support_ligatures':True,
'RIAL SIGN':True,
}
reshaper=ArabicReshaper(configuration=config1)
text=u"????"
reshaped_text=reshaper.reshape(text)
print(sys.stdout.encoding)
print(reshaped_text.encode('utf-8'))
错误:
F:\HisHands\Yang>F:\HisHands\Yang\dist\bob_test_1.exe
WARNING: file already exists but should not: C:\Users\Ownerc\AppData\Local\Temp\
_MEI153402\include\pyconfig.h
Traceback (most recent call last):
File "", line 13, in
File "C:\Users\Ownerc\Downloads\PyInstaller-2.1\PyInstaller-2.1\PyInstaller\lo
ader\pyi_importers.py", line 270, in load_module
File "F:\HisHands\Yang\build\bob_test_1\out00-PYZ.pyz\arabic_reshaper", line 1
, in
File "C:\Users\Ownerc\Downloads\PyInstaller-2.1\PyInstaller-2.1\PyInstaller\lo
ader\pyi_importers.py", line 270, in load_module
File "F:\HisHands\Yang\build\bob_test_1\out00-PYZ.pyz\arabic_reshaper.arabic_r
eshaper", line 1377, in
File "F:\HisHands\Yang\build\bob_test_1\out00-PYZ.pyz\arabic_reshaper.arabic_r
eshaper", line 1248, in __init__
ValueError: Invalid configuration: A section with the name ArabicReshaper was no
t found
我还使用了归档查看器工具来查看生成的可执行文件的内容,如下所示
pos, length, uncompressed, iscompressed, type, name
[(0, 170, 235, 1, 'm', u'struct'),
(170, 1153, 2704, 1, 'm', u'pyimod01_os_path'),
(1323, 4222, 11804, 1, 'm', u'pyimod02_archive'),
(5545, 6034, 18956, 1, 'm', u'pyimod03_importers'),
(11579, 1589, 4450, 1, 's', u'pyiboot01_bootstrap'),
(13168, 347, 504, 1, 's', u'bob_test_1'),
(13515, 48403, 89416, 1, 'b', u'VCRUNTIME140.dll'),
(61918, 39529, 87552, 1, 'b', u'_bz2.pyd'),
(101447, 624405, 1443840, 1, 'b', u'_hashlib.pyd'),
(725852, 76667, 146432, 1, 'b', u'_lzma.pyd'),
(802519, 28814, 66048, 1, 'b', u'_socket.pyd'),
(831333, 888894, 2045440, 1, 'b', u'_ssl.pyd'),
(1720227, 10439, 19136, 1, 'b', u'api-ms-win-core-console-l1-1-0.dll'),
(1730666, 10253, 18624, 1, 'b', u'api-ms-win-core-datetime-l1-1-0.dll'),
(1740919, 10265, 18624, 1, 'b', u'api-ms-win-core-debug-l1-1-0.dll'),
(1751184, 10322, 18624, 1, 'b', u'api-ms-win-core-errorhandling-l1-1-0.dll'),
(1761506, 11406, 22208, 1, 'b', u'api-ms-win-core-file-l1-1-0.dll'),
(1772912, 10289, 18624, 1, 'b', u'api-ms-win-core-file-l1-2-0.dll'),
(1783201, 10419, 18624, 1, 'b', u'api-ms-win-core-file-l2-1-0.dll'),
(1793620, 10290, 18624, 1, 'b', u'api-ms-win-core-handle-l1-1-0.dll'),
(1803910, 10469, 19136, 1, 'b', u'api-ms-win-core-heap-l1-1-0.dll'),
(1814379, 10302, 18624, 1, 'b', u'api-ms-win-core-interlocked-l1-1-0.dll'),
(1824681, 10532, 19136, 1, 'b', u'api-ms-win-core-libraryloader-l1-1-0.dll'),
(1835213, 11178, 21184, 1, 'b', u'api-ms-win-core-localization-l1-2-0.dll'),
(1846391, 10461, 19136, 1, 'b', u'api-ms-win-core-memory-l1-1-0.dll'),
(1856852, 10395, 18624, 1, 'b', u'api-ms-win-core-namedpipe-l1-1-0.dll'),
(1867247,
10555,
19648,
1,
'b',
u'api-ms-win-core-processenvironment-l1-1-0.dll'),
(1877802, 11078, 20672, 1, 'b', u'api-ms-win-core-processthreads-l1-1-0.dll'),
(1888880, 10498, 19136, 1, 'b', u'api-ms-win-core-processthreads-l1-1-1.dll'),
(1899378, 10215, 18112, 1, 'b', u'api-ms-win-core-profile-l1-1-0.dll'),
(1909593, 10486, 19136, 1, 'b', u'api-ms-win-core-rtlsupport-l1-1-0.dll'),
(1920079, 10347, 18624, 1, 'b', u'api-ms-win-core-string-l1-1-0.dll'),
(1930426, 10870, 20672, 1, 'b', u'api-ms-win-core-synch-l1-1-0.dll'),
(1941296, 10524, 19136, 1, 'b', u'api-ms-win-core-synch-l1-2-0.dll'),
(1951820, 10598, 19648, 1, 'b', u'api-ms-win-core-sysinfo-l1-1-0.dll'),
(1962418, 10376, 18624, 1, 'b', u'api-ms-win-core-timezone-l1-1-0.dll'),
(1972794, 10274, 18624, 1, 'b', u'api-ms-win-core-util-l1-1-0.dll'),
(1983068, 10607, 19648, 1, 'b', u'api-ms-win-crt-conio-l1-1-0.dll'),
(1993675, 11729, 22720, 1, 'b', u'api-ms-win-crt-convert-l1-1-0.dll'),
(2005404, 10429, 19136, 1, 'b', u'api-ms-win-crt-environment-l1-1-0.dll'),
(2015833, 11063, 20672, 1, 'b', u'api-ms-win-crt-filesystem-l1-1-0.dll'),
(2026896, 10584, 19648, 1, 'b', u'api-ms-win-crt-heap-l1-1-0.dll'),
(2037480, 10540, 19136, 1, 'b', u'api-ms-win-crt-locale-l1-1-0.dll'),
(2048020, 13628, 27840, 1, 'b', u'api-ms-win-crt-math-l1-1-0.dll'),
(2061648, 10654, 19648, 1, 'b', u'api-ms-win-crt-process-l1-1-0.dll'),
(2072302, 11901, 23232, 1, 'b', u'api-ms-win-crt-runtime-l1-1-0.dll'),
(2084203, 12357, 24768, 1, 'b', u'api-ms-win-crt-stdio-l1-1-0.dll'),
(2096560, 12530, 24768, 1, 'b', u'api-ms-win-crt-string-l1-1-0.dll'),
(2109090, 11174, 21184, 1, 'b', u'api-ms-win-crt-time-l1-1-0.dll'),
(2120264, 10601, 19136, 1, 'b', u'api-ms-win-crt-utility-l1-1-0.dll'),
(2130865, 485, 1035, 1, 'b', u'bob_test_1.exe.manifest'),
(2131350, 74629, 189952, 1, 'b', u'pyexpat.pyd'),
(2205979, 1637554, 3938304, 1, 'b', u'python35.dll'),
(3843533, 9127, 19968, 1, 'b', u'select.pyd'),
(3852660, 446584, 982720, 1, 'b', u'ucrtbase.dll'),
(4299244, 341035, 865792, 1, 'b', u'unicodedata.pyd'),
(4640279,
0,
0,
0,
'o',
u'pyi-windows-manifest-filename bob_test_1.exe.manifest'),
(4640279, 197523, 761033, 1, 'x', u'base_library.zip'),
(4837802, 1198430, 1198430, 0, 'z', u'out00-PYZ.pyz')]
?
由于