Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6886075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:42:51+00:00 2026-05-27T05:42:51+00:00

I have a working Python 2.6 code using matplotlib, and would like to get

  • 0

I have a working Python 2.6 code using matplotlib, and would like to get a working exe out of it. I am having problems getting this accomplished:

Initially I got an error for missing MSCVP90.dll, but I downloaded that and extracted the .dll to the working directory and that error went away.

I had some errors regarding a missing tkagg module, but I added that to the exceptions and edited the matplotlibrc file to default to WXAgg instead and that went away.

The exe runs normally, but at the end of the code it is supposed to display a plot, and it doesn’t. The plot is the main goal of this program, so it would be good to have this.

Just running the python code brings the plot up just fine.

Can anyone offer any suggestions or insights?

Here’s my setup.py:

from distutils.core import setup
import py2exe
import matplotlib
matplotlib.use('wxagg') # overrule configuration
import pylab


setup(
    console=['test1.py'],
    options={
             'py2exe': {
                        'excludes': ['_gtkagg', '_tkagg', 'backend_tkagg'],
                       }
            },
    data_files=matplotlib.get_py2exe_datafiles(),

)

Thanks in advance!



Alright, I used pyinstaller and reverted the matplotlibrc file back to its original state where TkAgg was the default and everything works on my computer, but when I try to run it on another computer the plot still does not appear…

I can use pyinstaller to compile an exe out of a very simple matplotlib code, like:

from pylab import *
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s, linewidth=1.0)
show()

But when I take that exe to another computer, it does not work.

Has anyone else had a similar issue? Any ideas?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:42:51+00:00Added an answer on May 27, 2026 at 5:42 am

    If the executable runs in your computer but doesn’t work in another computer, the most likely problem is the lack of one or more of the required dlls that py2exe doesn’t pack because license problems.

    Very often these dlls are

    gdiplus.dll
    msvcp90.dll
    

    Look for them in the computer where the exe works and copy them to the failing computer.
    If the exe still doesn’t work, check for other dll’s. Py2exe gives the list of binary dependencies:

    *** binary dependencies ***
    Your executable(s) also depend on these dlls which are not included,
    you may or may not need to distribute them.
    
    Make sure you have the license if you distribute any of them, and
    make sure you don't distribute files belonging to the operating system.
    
       OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
       USER32.dll - C:\Windows\system32\USER32.dll
       gdiplus.dll - gdiplus.dll
       SHELL32.dll - C:\Windows\system32\SHELL32.dll
       ole32.dll - C:\Windows\system32\ole32.dll
       RPCRT4.dll - C:\Windows\system32\RPCRT4.dll
       WSOCK32.dll - C:\Windows\system32\WSOCK32.dll
       WINMM.dll - C:\Windows\system32\WINMM.dll
       ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
       msvcrt.dll - C:\Windows\system32\msvcrt.dll
       WS2_32.dll - C:\Windows\system32\WS2_32.dll
       WINSPOOL.DRV - C:\Windows\system32\WINSPOOL.DRV
       GDI32.dll - C:\Windows\system32\GDI32.dll
       IMM32.dll - C:\Windows\system32\IMM32.dll
       MSVCP90.dll - C:\Python26\programas\test\MSVCP90.dll
       KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
       ntdll.dll - C:\Windows\system32\ntdll.dll
       COMCTL32.dll - C:\Windows\system32\COMCTL32.dll
       COMDLG32.dll - C:\Windows\system32\COMDLG32.dll
       VERSION.dll - C:\Windows\system32\VERSION.dll
    
    C:\Python26\programas\test>
    

    Finally, I succesfully got a functional matplotlib program executable with py2exe. I only needed to add an 'includes' to setup.py and set WXAgg as the backend in matplotlib.rc (with Tk I got the same problem you described…). For it to work, I had to set WXAgg in the original matplotlib.rc (in the matplotlib/mpl-data folder). This is the one py2exe imports (not the one in the user’s matplotlib configuration directory). To be sure check the .rc file in your dist folder.

    from distutils.core import setup
    import py2exe
    import matplotlib
    
    setup(
        console=['test1.py'],
        options={
                 'py2exe': {
                            'excludes': ['Tkconstants','Tkinter', 'tcl'],
                            'includes': ['matplotlib.backends.backend_wxagg'],
                           }
                },
        data_files=matplotlib.get_py2exe_datafiles(),
    
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently been working with Python using Komodo Edit and other simpler editors
I have a Python module that I would like to upload to PyPI. So
I'm using Django/Python, but pseudo-code is definitely acceptable here. Working with some models that
Here is the working code in Python (using cURL): #!/usr/bin/python import pycurl c =
I have been working on getting a python CGI script to work all day,
Working on a small web spider in python, using the lxml module I have
I'm trying to simulate some code that I have working with SQL but using
I am new to Python, and I'm working on writing some database code using
I need to have an at-home project now that I'm working on Python/Django at
I am working with Google App Engine and Python. I have a model with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.