Python Forum
PyInstaller Executable Does Nothing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyInstaller Executable Does Nothing
#11
(Feb-17-2021, 06:58 PM)pdihawk Wrote: What exactly do you mean by the full traceback? :)
the full error, not just the last line


EDIT
I see that in __init__.py it catch the error and obfuscate the error, print this message without providing much information. So there is no traceback
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#12
My whole command prompt:
[inline]C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\dist>ShowJulian.exe
tkinter did not import successfully. Please check your setup.[/inline]
Reply
#13
When I run pyinstaller I get the following:
Output:
pyinstaller ShowJulian.spec 55 INFO: PyInstaller: 4.2 56 INFO: Python: 3.7.3 56 INFO: Platform: Windows-10-10.0.18362-SP0 57 INFO: UPX is not available. 58 INFO: Extending PYTHONPATH with paths ['C:\\Users\\PDI ' 'User\\AppData\\Local\\Programs\\Python\\Python38-32\\ShowJulian', 'C:\\Users\\PDI ' 'User\\AppData\\Local\\Programs\\Python\\Python38-32\\ShowJulian\\dist'] 65 INFO: checking Analysis 67 INFO: Building because C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\ShowJulian.py changed 68 INFO: Initializing module dependency graph... 69 INFO: Caching module graph hooks... 79 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict. 82 INFO: Analyzing base_library.zip ... 2519 INFO: Caching module dependency graph... 2613 INFO: running Analysis Analysis-00.toc 2615 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable required by c:\users\pdi user\appdata\local\programs\python\python37\python.exe 2670 INFO: Analyzing ShowJulian.py 2763 INFO: Processing module hooks... 2763 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\pdi user\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'... 2764 INFO: Excluding import of doctest from module difflib 2764 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\pdi user\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'... 2835 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\pdi user\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'... 2836 INFO: Excluding import of doctest from module heapq 2836 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\pdi user\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'... 2840 INFO: Excluding import of argparse from module pickle 2844 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\pdi user\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'... 3035 INFO: Looking for ctypes DLLs 3035 INFO: Analyzing run-time hooks ... 3043 INFO: Looking for dynamic libraries 3163 INFO: Looking for eggs 3164 INFO: Using Python library c:\users\pdi user\appdata\local\programs\python\python37\python37.dll 3165 INFO: Found binding redirects: [] 3167 INFO: Warnings written to C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\build\ShowJulian\warn-ShowJulian.txt 3201 INFO: Graph cross-reference written to C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\build\ShowJulian\xref-ShowJulian.html 3210 INFO: checking PYZ 3212 INFO: Building because toc changed 3213 INFO: Building PYZ (ZlibArchive) C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\build\ShowJulian\PYZ-00.pyz 3650 INFO: Building PYZ (ZlibArchive) C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\build\ShowJulian\PYZ-00.pyz completed successfully. 3664 INFO: checking PKG 3665 INFO: Building because toc changed 3665 INFO: Building PKG (CArchive) PKG-00.pkg 5205 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully. 5208 INFO: Bootloader c:\users\pdi user\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe 5209 INFO: checking EXE 5210 INFO: Building because toc changed 5211 INFO: Building EXE from EXE-00.toc 5214 INFO: Copying icons from ['C:\\Users\\PDI User\\AppData\\Local\\Programs\\Python\\Python38-32\\ShowJulian\\app.ico'] 5215 INFO: Writing RT_GROUP_ICON 0 resource with 20 bytes 5215 INFO: Writing RT_ICON 1 resource with 32907 bytes 5221 INFO: Updating manifest in C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\build\ShowJulian\run.exe.b0wujt10 5223 INFO: Updating resource type 24 name 1 language 0 5227 INFO: Appending archive to EXE C:\Users\PDI User\AppData\Local\Programs\Python\Python38-32\ShowJulian\dist\ShowJulian.exe 5232 INFO: Building EXE from EXE-00.toc completed successfully.
I'm not really sure what to make of this. Is it helpful?
Reply
#14
It worked OK for me on Win 7 Python V3.76

Try this line on pyinstaller:

pyinstaller yourapp.py -n yourapp --windowed --onefile
Reply
#15
Using that gives me the same issue.

Is my problem that I wrote my app in Python 3.8 and for some reason pyinstaller is running out of the 3.7?

I used IDLE(Python 3.8) to write my code. Is there a way to associate pyinstaller with 3.8 or do I have to use Python 3.7?
Reply
#16
So I Installed IDLE 3.7.1, copied it over and still no luck. It still tells me that tkinter did not import successfully.
Reply
#17
It looks like a problem with your setup.

Did you tick "path" on the Python installer
when you installed Python?
Are you using a virtual environment?
pdihawk likes this post
Reply
#18
(Feb-18-2021, 10:13 PM)pdihawk Wrote: So I Installed IDLE 3.7.1, copied it over and still no luck. It still tells me that tkinter did not import successfully.
That's not how you do it,and IDLE come with Python.
Look at Python 3.9/3.8 and pip installation under Windows.
So if Python 3.8 is the main version you want to use then python and pip should point to Python 3.8.
If not fix Environment Variables Path as i explain in link over.
Example cmd.
# Test Python
C:\>python -V
Python 3.9.1

# Test pip
C:\>pip -V
pip 20.2.4 from c:\python39\lib\site-packages\pip (python 3.9)
Now you see that pip point to Python 3.9.
Then will pip install pyinstaller --upgrade install to Python 3.9.
# Install pyinstaller
C:\>pip install pyinstaller --upgrade
Collecting pyinstaller
  Downloading .....
Successfully built pyinstaller

# See Location
C:\>pip show pyinstaller
Name: pyinstaller
Version: 4.2
Summary: PyInstaller bundles a Python application and all its dependencies into
a single package.
Home-page: http://www.pyinstaller.org/
Author: Hartmut Goebel, Giovanni Bajo, David Vierra, David Cortesi, Martin Zibri
cky
Author-email: None
License: GPLv2-or-later with a special exception which allows to use PyInstaller
 to build and distribute non-free programs (including commercial ones)
Location: c:\python39\lib\site-packages
Requires: pyinstaller-hooks-contrib, altgraph, setuptools, pefile, pywin32-ctype
So when i now when i eg do as in link is posted.
pyinstaller --onefile --windowed --icon=idea.ico tk_test.py
Pyinstaller will now of course use Python 3.9,just the same setup for 3.8.
Reply
#19
Yup. I cleaned up my PATH to only include Python 3.8 and I can now create an executable that works!

Thank you!!
nilamo likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with pyinstaller to create an executable file atlass218 0 2,539 May-15-2021, 11:01 AM
Last Post: atlass218
  Python 3.7, Windows 10, pyinstaller, winsound, no sound in executable kmarien 3 3,592 Nov-30-2020, 04:10 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020