Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to convert Py module to executable #933

Open
seelebrn opened this issue Sep 3, 2024 · 4 comments
Open

Failed to convert Py module to executable #933

seelebrn opened this issue Sep 3, 2024 · 4 comments

Comments

@seelebrn
Copy link
Contributor

seelebrn commented Sep 3, 2024

Describe the bug :

When trying to run python setup.py py2exe (using the setup.py file included in the code .zip pulled from github), the app is built, but running it results in this kind of error log :
Traceback (most recent call last):
File "main.py", line 49, in
File "zipextimporter.pyc", line 150, in create_module
ImportError: MemoryLoadLibrary failed loading PyQt6\QtCore.pyd: Le module spécifié est introuvable. (126)
Traceback (most recent call last):
File "main.py", line 49, in
File "zipextimporter.pyc", line 150, in create_module
ImportError: MemoryLoadLibrary failed loading PyQt6\QtCore.pyd: Le module spécifié est introuvable. (126)
Traceback (most recent call last):
File "main.py", line 49, in
File "", line 15, in
File "", line 13, in __load
ImportError: (No module named 'PyQt6.sip') 'C:\Users\needa\Downloads\QualCoder-master\dist\PyQt6.QtCore.pyd'
Traceback (most recent call last):
File "main.py", line 49, in
File "", line 15, in
File "", line 13, in __load
ImportError: (DLL load failed while importing QtCore: Le module spécifié est introuvable.) 'C:\Users\needa\Downloads\QualCoder-master\dist\PyQt6.QtCore.pyd'
Traceback (most recent call last):
File "main.py", line 49, in
File "zipextimporter.pyc", line 150, in create_module
ImportError: MemoryLoadLibrary failed loading PyQt6\QtCore.pyd: Le module spécifié est introuvable. (126)
[etc.]

Additional bit of info : the created app is named main.exe and with no icons. I feel it shouldn't be that way, so something may be wrong here.

Edit : Failed to mention that running the py module with "python -m qualcoder" works flawlessly.

To Reproduce :


Described above. It's very possible it shouldn't be how I try to convert the module to an exe. In which case, I'm very sorry.

Expected behavior :


Well, I suppose using either the python setup.py py2exe (or a more correct way to do it), the .exe should be working ?

Screenshots :


If applicable, add screenshots that helps to explain your problem.

Desktop (please complete the following information):

  • OS: Win 11

Additional context :


Maybe it should be useful to include a few steps to exe-ify the module ?
I'm trying to rebuild it this way because I added a few QoL tweaks for my specific use case.

Thanks in advance and sorry if I'm just being noob.

@ccbogel
Copy link
Owner

ccbogel commented Sep 3, 2024

Hi. I am glad you can use QualCoder for your needs.
And that you can edit the code to suit your special QoL needs.

On Windows 10 or 11:

To make an exe from source code:
Ignore the setup.py
Without using a virtual environment - No venv

1 Download the QualCoder-master zip (This is the latest code, or you can download the 3.5 source code from the releases)
Edit the files you need to edit for your QoL.

2 Unzip

3
py -m pip install --upgrade pip (OR replace py with python3 - some Windows need this instead) python3 -m pip install --upgrade pip

4 Install these modules - pyinstaller is the important one to create the exe
py -m pip install wheel pyqt6 chardet ebooklib openpyxl Pillow ply pdfminer.six pandas plotly pydub python-vlc rispy SpeechRecognition pyinstaller

5 cd to the QualCoder-master folder

6 Run this command from the above folder, to create an exe. It takes about 10 minutes
pyinstaller -w -n "QualCoder-3.6" --onefile qualcoder/__main__.py

7
The exe will be in another folder called Dist

8
Open Dist Folder - and Double-click the exe to run

@seelebrn
Copy link
Contributor Author

seelebrn commented Sep 4, 2024

Thank you very much, worked like a charm !

@seelebrn seelebrn closed this as completed Sep 4, 2024
@ccbogel
Copy link
Owner

ccbogel commented Sep 4, 2024

I'm pleased. If some of the QoL tweaks would improve QualCoder - please let me know.

@seelebrn
Copy link
Contributor Author

seelebrn commented Sep 11, 2024

Ty so much !
I didn't really dare to make a pull request since I'm basically an amateur coder, but if you find some ideas interesting I made a specific fork for my attempts at adding a few QoL tweaks, namely :

-Making columns resizeable in the code_text widget (since we're working with quite lengthy code labels here)
-Making it possible to bulk rename files in manage_files, incrementing from a user defined {base_name}, so that if the user enters "Interview", the files will be renamed to :
Interview_001
Interview_002, etc.

This second tweak was to answer a specific situation with more than a hundred files and to make life easier for a student.

If you think it'd be interesting to do a PR even with my.. err.. bad coding skills, I'll gladly do it. But if you want to take things for the fork, refine them and include them in the base version, I'll be super happy too (and maybe less ashamed !).

Best regards,

@seelebrn seelebrn reopened this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants