extracting python exe created via Iexpress getting ImportError: DLL load failed: The specified module could not be found. Error - pyqt

I build one code and then created a exe from .py using py2exe .
Now i want to create a self expracted for the same so i used Iexpress to do that . I am able to create the exe from Iexpress but when i try to extract my application from the exe created i get following error :
Traceback (most recent call last):
File "C.py", line 44, in <module>
File "A.pyc", line 4, in <module>
File "PyQt4\QtGui.pyc", line 12, in <module>
File "PyQt4\QtGui.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
It seems , error is all coming in line :
from PyQt4 import QtCore, QtGui
I saw some ways to fix this on internet but couldnt succeed to fix this . Anyone have any ideas ?

I tried to reproduce this here, but it seems to work fine. Here's what I did:
Created a file hello-pyqt.py using this question:
How to implement a simple button in PyQt
Created a setup.py:
from distutils.core import setup
import py2exe
setup(console=['hello-pyqt.py'],
options={'py2exe': {'bundle_files': 1,
'dll_excludes': ['w9xpopen.exe', 'MSVCP90.dll'],
'includes': ['sip']}}
)
The dll_excludes and includes tricks came from an answer on py2exe fails to generate an executable and this Py2exeAndPyQt page, respectively.
Executed setup.py:
python setup.py py2exe
Tested the output before using IExpress:
dist\hello-pyqt.exe
Bundled it with IExpress in the usual way:
Added both hello-pyqt.exe and library.zip.
Set the Install Command to hello-pyqt.exe.
Enabled Long File Name support.
Compare your process with the one I'm using (above) and see if there's anything that might help. Failing that, I'd use Process Monitor to see which DLL it's failing to load and where it's looking.
The DLLs that are bundled in my library.zip are: QtCore4.dll and QtGui4.dll. You might want to check your library.zip to make sure those files are there.

Related

Issue in importing awkward array package: DLL load failed while importing _ext

I am trying to use awkward in my Windows 10 system. I am using python 3.8.2.
After installing the package, when I import it, I am getting this DLL import error.
>>> import awkward as ak
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\MSS\Work\PyWorkspace37\awkward_poc\venv\lib\site-packages\awkward\__init__.py", line 23, in <module>
import awkward.layout
File "C:\Users\MSS\Work\PyWorkspace37\awkward_poc\venv\lib\site-packages\awkward\layout.py", line 5, in <module>
from awkward._ext import Index8
ImportError: DLL load failed while importing _ext: The specified module could not be found.
How to know which DLL is missing and how to mitigate it?
The DLL is Awkward Array's C++ part, "awkward/_ext.pyc", which the installation should have put into place. I see two possibilities: (1) the installation went horribly wrong and should be restarted from a clean slate, or (2) the file is there but can't be loaded. If the directory it was installed to doesn't have executable permissions, that could be it. (Python code can be executed from a disk/directory without executable permissions, but native machine code can't be, which can cause some surprises.)
When it comes to installation issues, I can only make guesses because your system is different than mine. We try to use standard installation procedures, so if you use the standard Python inhalation tools (pip, conda) then it ought to work without problems, but evidently that didn't happen here.

import PyOpenPose as OP ImportError: DLL load failed: The specified module could not be found

Working on a Windows 10
Trying to set up pose2pose, which needs PyOpenPose and OpenPose to run
keep running into the issue in the code below:
I'v added every combination of every variable to my paths, and my PYTHONPATH and even made python37.pth and directed it to my module and still nothing.
Edit: when building PyOpenPose built with Cmake and then in visual studio 2019, the config propertys were set to .dll but no .dll was made, instead i have a .lib, .exe, and .pyd in C:\Users\conta\Documents\GithubRepos\pyopenpose\build\PyOpenPoseLib\Release
Traceback (most recent call last):
File "generate_train_data.py", line 5, in <module>
import PyOpenPose as OP
ImportError: DLL load failed: The specified module could not be found.

ModuleNotFoundError: No module named '_pydevd_bundle'

Out of the blue I got the error listed below.
I am using Eclipse IDE and I have Python 2.7 and 3.6 installed (both WinPython)
I don't know when this started because I have worked for a while in 2.7. I just tried some code which I am writing in Jupyter and it is not working and I wanted to debug it easier in Eclipse. When I press the debug button I get the below
Traceback (most recent call last):
File "C:\Utils\PortableApps\PortableApps\Eclipse 4.6\plugins\org.python.pydev.core_7.0.3.201811082356\pysrc\pydevd.py", line 20, in <module>
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PYCHARM, get_thread_id, get_current_thread_id, \
ModuleNotFoundError: No module named '_pydevd_bundle'
It's absolutely due to that your files contain a dir named code! The name has conflicted with the system package. Just modify the dir name code to any name else. It should work well!

cx_Freeze converted exe: window closes immediately

I am trying to just convert my pygame python py to a .exe file using cx_Freeze. The setup file executes correctly and without error, but the issue is that when I run my .exe file the console window (the black cmd-like window)will open quickly and close. My .py which I want to convert is called Salary.py, and it includes a .input('str') codes in it so that the
user can decide which csv file they want to use.
Description of my Salary.py: if the user input an interger, Salary.py help them to parse through one existed csv file and run the
script and output to another csv file.
Chinese is included inside the code.
Once again, there is no error running when I run Salary.py in python3.6, and no error when building the exe file for now.
The setup.py I am using:
from cx_Freeze import setup, Executable
import os
os.environ['TCL_LIBRARY'] = r'D:\Anaconda3\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'D:\Anaconda3\tcl\tcl8.6'
setup(name='Salary',
version='0.1',
description='Salarycount',
executables= [Executable("Salary.py")])
I try to execute the Salary.exe in cmd. And it gave this to me:
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
module.run()
File "D:\Anaconda3\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
exec(code, m.__dict__)
File "Salary.py", line 8, in <module>
File "D:\Anaconda3\lib\site-packages\pandas\__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
Apperently, numpy has already installed to my python packages, I don't even know what does it mean.
my environment:
Anaconda 3
python 3.6
cx-Freeze 6.0b1
It looks like your Salary.py script uses the pandas package, is this correct? The pandas package requires the numpy package to work, and one needs to tell cx_Freeze explicitly to include the numpy package. Try to add the following options to setup:
from cx_Freeze import setup, Executable
import os
os.environ['TCL_LIBRARY'] = r'D:\Anaconda3\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'D:\Anaconda3\tcl\tcl8.6'
setup(name='Salary',
version='0.1',
description='Salarycount',
options={'build_exe': {'packages': ['numpy']}},
executables= [Executable("Salary.py")])

How do I make PyInstaller bundle Tcl/Tk for OSX targets? - Import Error Tcl/Tk modules not found - Pyinstaller on Mac is not working

I have a frustrating problem that set me back a day trying to get an executable file from my finished bookstore app.
I used the Pyinstaller --onefile --windowed bookstore.py from the main project menu, also vm/bin/Pyinstaller --onefile --windowed bookstore.py which created the .exe and .app file successfully.
HOWEVER, when running the .app file, nothing happens. It starts, and just disappears.
I ran the core executable from the cli on Mac from the main project folder with open dist/bookstore.app/Contents/Macos/bookstore and, loads of research and over 20 variations of code and file changes later, I got the same same trackback (N.B. different file path for global Pyinstaller) error message back from the console.
Traceback (most recent call last):
File "bookstore.py", line 5, in <module>
File "/Users/jmulhall/Documents/Documents/Python_Project_Folder/Python3_Training/ProjectBookstore/vm/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "tkinter/__init__.py", line 36, in <module>
File "/Users/jmulhall/Documents/Documents/Python_Project_Folder/Python3_Training/ProjectBookstore/vm/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
ImportError: dlopen(/var/folders/0d/6l_1mgwn4cxbrx21_nm7l8gh0000gn/T/_MEIHyYK9G/_tkinter.so, 2): Library not loaded: #loader_path/Tcl
Referenced from: /var/folders/0d/6l_1mgwn4cxbrx21_nm7l8gh0000gn/T/_MEIHyYK9G/_tkinter.so
Reason: image not found
[3899] Failed to execute script bookstore
My Mac details are as follows:
MacOs High Sierra V 10.13.3 with a standard HD on a mid 2012 Macbook Pro
My Software versions are python 3.6.4, pyinstaller 3.3.1 , virtualenv 15.1.0, sqllite3 3.19.3
The most promsing fix on github did not work ergo my query on fixing the Pyinstaller issue for mac where it loads the tcl and tk resources. The links I followed are here:​
Main Query Link - Github​,
Support File Changes Demo for hooks​
I created a pyinstaller-hooks folder and inserted the hook and pyruntime hooks file into the folder with the tclResources and tkResources name changes in the files as follows:
This did not work.
And I am still getting the above stack trace despite running the new command, picking up the new pyinstaller-hooks folder files in the main project folder, as follows:
pyinstaller --onefile --windowed --additional-hooks-dir pyinstaller-
hooks --runtime-hook pyinstaller-hooks/pyi_rth__tkinter.py bookstore.py
Why is it still not finding the the new files with Tree() and os.path.join()) functions altered to tkResources/tclResources and thus crashing the app when it tries to launch. I could not test the .exe as I have only a Mac environment so Im only focused on the .app right now. Can anybody help with this?
Nearly forgot, my main project folder view is as follows:

Resources