Python Forum
Tranforming into .exe with Matplotlib (graphs)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tranforming into .exe with Matplotlib (graphs)
#1
Hello everyone,

I am creating a small program based on an excel file and I could transform it into an .exe and run on other computers.
However now I add some graphs and when I transform the script into an .exe it will not open.
Can someone give it a check please?

The code I used to transform into .exe by CMD was as below:
 pyinstaller --onefile -w FILENAME.py 
After running the above code, it creates the .exe, and the error is "Failed to execute scrip FILENAME"

On CMD I see many "Ignored" for Matplotlib, but I do not know what they mean.

Here what happens on CMD:

C:\Users\Kituzeira\PycharmProjects\TESTE>pyinstaller --onefile -w TESTE.py
94 INFO: PyInstaller: 3.5
94 INFO: Python: 3.7.4
97 INFO: Platform: Windows-10-10.0.18362-SP0
102 INFO: wrote C:\Users\Kituzeira\PycharmProjects\TESTE\TESTE.spec
110 INFO: UPX is not available.
120 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Kituzeira\\PycharmProjects\\TESTE',
'C:\\Users\\Kituzeira\\PycharmProjects\\TESTE']
122 INFO: checking Analysis
130 INFO: Building Analysis because Analysis-00.toc is non existent
133 INFO: Initializing module dependency graph...
149 INFO: Initializing module graph hooks...
158 INFO: Analyzing base_library.zip ...
4037 INFO: running Analysis Analysis-00.toc
4042 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\kituzeira\appdata\local\programs\python\python37-32\python.exe
5417 INFO: Caching module hooks...
5431 INFO: Analyzing C:\Users\Kituzeira\PycharmProjects\TESTE\TESTE.py
5666 INFO: Processing pre-find module path hook distutils
7609 INFO: Processing pre-find module path hook site
7611 INFO: site: retargeting to fake-dir 'c:\\users\\kituzeira\\appdata\\local\\programs\\python\\python37-32\\lib\\site-packages\\PyInstaller\\fake-modules'
9136 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
12787 INFO: Processing pre-safe import module hook six.moves
18190 INFO: Loading module hooks...
18190 INFO: Loading module hook "hook-distutils.py"...
18198 INFO: Loading module hook "hook-encodings.py"...
18327 INFO: Loading module hook "hook-lib2to3.py"...
18336 INFO: Loading module hook "hook-matplotlib.backends.py"...
19378 INFO: Matplotlib backend "GTK3Agg": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
19924 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
20631 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\matplotlib\backends\__init__.py)
21167 INFO: Matplotlib backend "nbAgg": ignored
No module named 'IPython'
21725 INFO: Matplotlib backend "Qt4Agg": ignored
Failed to import any qt binding
22260 INFO: Matplotlib backend "Qt4Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
22819 INFO: Matplotlib backend "Qt5Agg": ignored
Failed to import any qt binding
23340 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
24058 INFO: Matplotlib backend "TkAgg": added
24906 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
25827 INFO: Matplotlib backend "WebAgg": added
26552 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
27079 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
27606 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
28125 INFO: Matplotlib backend "agg": added
28654 INFO: Matplotlib backend "cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
29373 INFO: Matplotlib backend "pdf": added
30078 INFO: Matplotlib backend "pgf": added
30602 INFO: Matplotlib backend "ps": added
31147 INFO: Matplotlib backend "svg": added
31824 INFO: Matplotlib backend "template": added
32162 INFO: Loading module hook "hook-matplotlib.py"...
32638 INFO: Loading module hook "hook-numpy.core.py"...
32855 INFO: Loading module hook "hook-numpy.py"...
32857 INFO: Loading module hook "hook-pkg_resources.py"...
33422 INFO: Processing pre-safe import module hook win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
33570 INFO: Processing pre-safe import module hook win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
33771 INFO: Loading module hook "hook-pydoc.py"...
33774 INFO: Loading module hook "hook-setuptools.py"...
34524 INFO: Loading module hook "hook-sysconfig.py"...
34531 INFO: Loading module hook "hook-xml.dom.domreg.py"...
34537 INFO: Loading module hook "hook-xml.py"...
34539 INFO: Loading module hook "hook-_tkinter.py"...
34900 INFO: checking Tree
34900 INFO: Building Tree because Tree-00.toc is non existent
34903 INFO: Building Tree Tree-00.toc
34991 INFO: checking Tree
34992 INFO: Building Tree because Tree-01.toc is non existent
34996 INFO: Building Tree Tree-01.toc
35110 INFO: Looking for ctypes DLLs
35165 INFO: Analyzing run-time hooks ...
35179 INFO: Including run-time hook 'pyi_rth_pkgres.py'
35180 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
35184 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
35186 INFO: Including run-time hook 'pyi_rth_mpldata.py'
35189 INFO: Including run-time hook 'pyi_rth__tkinter.py'
35215 INFO: Looking for dynamic libraries
46772 INFO: Looking for eggs
46773 INFO: Using Python library c:\users\kituzeira\appdata\local\programs\python\python37-32\python37.dll
46775 INFO: Found binding redirects:
[]
46817 INFO: Warnings written to C:\Users\Kituzeira\PycharmProjects\TESTE\build\TESTE\warn-TESTE.txt
47066 INFO: Graph cross-reference written to C:\Users\Kituzeira\PycharmProjects\TESTE\build\TESTE\xref-TESTE.html
47165 INFO: checking PYZ
47165 INFO: Building PYZ because PYZ-00.toc is non existent
47168 INFO: Building PYZ (ZlibArchive) C:\Users\Kituzeira\PycharmProjects\TESTE\build\TESTE\PYZ-00.pyz
49654 INFO: Building PYZ (ZlibArchive) C:\Users\Kituzeira\PycharmProjects\TESTE\build\TESTE\PYZ-00.pyz completed successfully.
49707 INFO: checking PKG
49708 INFO: Building PKG because PKG-00.toc is non existent
49711 INFO: Building PKG (CArchive) PKG-00.pkg
58840 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
58898 INFO: Bootloader c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe
58898 INFO: checking EXE
58908 INFO: Building EXE because EXE-00.toc is non existent
58909 INFO: Building EXE from EXE-00.toc
Traceback (most recent call last):
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Kituzeira\AppData\Local\Programs\Python\Python37-32\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
exec(code, spec_namespace)
File "C:\Users\Kituzeira\PycharmProjects\TESTE\TESTE.spec", line 33, in <module>
console=False )
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\api.py", line 444, in __init__
self.__postinit__()
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
self.assemble()
File "c:\users\kituzeira\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\api.py", line 521, in assemble
os.remove(self.name)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\Kituzeira\\PycharmProjects\\TESTE\\dist\\TESTE.exe'
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Plot several graphs on the same row Menthix 1 1,030 Mar-18-2022, 05:47 PM
Last Post: deanhystad
  grouped bar graphs tobiasfw 1 1,399 Feb-22-2022, 02:25 PM
Last Post: deanhystad
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,214 Mar-11-2021, 10:52 AM
Last Post: buran
  Python Matplotlib: How do I save (in pdf) all the graphs I create in a loop? JaneTan 1 8,849 Feb-28-2021, 06:20 PM
Last Post: Larz60+
  How to merge strings through graphs Den 6 3,404 Jun-29-2020, 07:07 AM
Last Post: Den
  How to clear matplotlib graphs from memory mrashy 0 4,547 Apr-01-2020, 04:03 AM
Last Post: mrashy
  Show graphs in matplotlib from a sql query? ScaleMan 1 1,852 Feb-06-2020, 05:47 PM
Last Post: ScaleMan
  Little Help With Graphs ericvrocha 5 3,173 Oct-14-2019, 12:07 PM
Last Post: buran
  Drawing graphs with matplotlib JRod 5 4,701 Jul-31-2017, 10:00 AM
Last Post: JRod

Forum Jump:

User Panel Messages

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