Код: Выделить всё
# main.py
from termcolor import cprint
def main() -> None:
cprint('Hello', 'red')
if __name__ == '__main__':
main()
Код: Выделить всё
poetry new test
Код: Выделить всё
poetry add termcolor
Код: Выделить всё
python main.py
Когда я создаю exe
Код: Выделить всё
pyinstaller --onefile main.py
Это мой main.spec< /em> файл
Код: Выделить всё
a = Analysis(
['main.py'],
pathex=['.', 'C:\Users\... path to ...\site-packages'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='main',
)
Подробнее здесь: https://stackoverflow.com/questions/786 ... in-windows