pyinstaller 打包exe报错
a = 1
print(a)
D:\Desktop\编程>pyinstaller -F 练习模式.py
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "D:\Python\Scripts\pyinstaller.exe\__main__.py", line 7, in
File "D:\Python\Lib\site-packages\PyInstaller\__main__.py", line 107, in run
parser = generate_parser()
^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\PyInstaller\__main__.py", line 78, in generate_parser
import PyInstaller.building.build_main
File "D:\Python\Lib\site-packages\PyInstaller\building\build_main.py", line 35, in
from PyInstaller.depend import bindepend
File "D:\Python\Lib\site-packages\PyInstaller\depend\bindepend.py", line 26, in
from PyInstaller.depend import dylib, utils
File "D:\Python\Lib\site-packages\PyInstaller\depend\utils.py", line 33, in
from PyInstaller.depend import bytecode
File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 95, in
_call_function_bytecode = bytecode_regex(rb"""
^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 60, in bytecode_regex
pattern = re.sub(
^^^^^^^
File "D:\Python\Lib\re\__init__.py", line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 62, in
lambda m: _instruction_to_regex(m[1].decode()),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 40, in _instruction_to_regex
return re.escape(bytes([dis.opmap[x]]))
~~~~~~~~~^^^
KeyError: 'CALL_FUNCTION'
尝试过不同代码和不同文件命名, 也重新安装过pyinstaller . 感觉问题出在了pyinstaller上.
将py文件打包成exe
看看你要打包的py文件,或者连带打包的其他文件