Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyInstaller cannot check for assembly dependencies

I am trying to make Tkinter GUI module with a build option to build Exes after the user puts some inputs & I don't want him to install python and pyinstaller to be able to Compile the code to Exe.

Using Python 3.6.0

I made 2 python scripts first-named compiler.py & other hello.py hello.pyprint("Hello World")

compiler.py

import PyInstaller.__main__
import ctypes
import win32ctypes
from win32ctypes import pywin32
from win32ctypes.pywin32 import pywintypes
import os

def compiling():
    PyInstaller.__main__.run([
        # '--name=%s' % package_name,
        '--onefile',
        '--windowed',
        # '--add-binary=%s' % os.path.join('resource', 'path', '*.png'),
        # '--add-data=%s' % os.path.join('resource', 'path', '*.txt'),
        # '--icon=%s' % os.path.join('resource', 'path', 'icon.ico'),
        os.path.join('hello.py'),  # my_package is a Directory
        # '--version-file=%s' % os.path.join('assembly.txt'),
    ])
compiling()

when I try to Compile compiler.py with pyinstaller it compiles successfully with -->pyinstaller --onefile --console compiler.py

but when I try to run the exe it throws

PyInstaller cannot check for assembly dependencies.
Please install pywin32-ctypes.

pip install pywin32-ctypes

What I Have Tried? 1-i installed pywin32-ctypes successfully 2-Tried to compile compiler.py with different alternatives other than pyinstaller 3-cx-freeze & nuitka both of them throw the same error when I Run after compiling. 4- tried using Python 3.7.5 on other machine start new fresh Throw the Same Error the reason I choose pyinstaller because it can build 1 EXE

https://github.com/pyinstaller/pyinstaller/issues/3892

https://github.com/pyinstaller/pyinstaller/issues/3793

Unable to run PyInstaller - "Please install PyWin32 or pywin32-ctypes"

All those Failed As Well is it something I am Doing Wrong or is Pyinstaller Problem

like image 261
omar18881 Avatar asked Dec 23 '22 19:12

omar18881


1 Answers

An old question but maybe someone could face the same issue. I found a solution and it works for me.

Installing this module solves the problem

pip install cffi

After installing, I tried the build again. Gives error-like warning.

Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'

You can fix this warning via installing pywin32

pip install pywin32

I hope it helped someone else.

like image 71
ErdoganOnal Avatar answered Apr 01 '23 04:04

ErdoganOnal