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

  • SEARCH
  • Home
  • 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 8161709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:33:26+00:00 2026-06-06T18:33:26+00:00

Possible Duplicate: Outputed py2exe exe won't run only when signed: ImportError I asked a

  • 0

Possible Duplicate:
Outputed py2exe exe won't run only when signed: ImportError

I asked a similar question previously (Creating executable with Py2exe and matplotlib errors) that dealt with matplotlib errors. However, I have gotten past this stage. Now when I try to build my executable, none of my packages/code seem to import. For example, my code imports the following:

import os
import csv
import wx
import time
import math

from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.pyplot import figure,show
from mpl_toolkits.basemap import Basemap
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
from numpy.random import rand
from datetime import datetime
import wx.calendar as cal
import numpy as npy
from pylab import *
import numpy as np
import matplotlib
import adodbapi
import sqlparse
import pylab
import annote_new
import cPickle as pickle

I get a log error when I run my executable that it “No Module Named os”. I get an error for every module I have in my code (if i change the order in which things are imported). Why aren’t any of my modules importing? My Py2exe code looks like:

import os
from distutils.core import setup 
import py2exe

from distutils.filelist import findall
import matplotlib
import glob

from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.pyplot import figure,show
from mpl_toolkits.basemap import Basemap
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
from numpy.random import rand
from datetime import datetime
import wx.calendar as cal
import numpy as npy
from pylab import *
import numpy as np
import matplotlib
import adodbapi
import sqlparse
import pylab
import annote_new
import cPickle as pickle
import wx


setup( 


windows=[{'script': r'Scout_Tool.py'}], 


data_files = [(r'mpl-data', glob.glob(r'C:\Python27\Lib\site-packages\matplotlib\mpl-data\*.*')),

              (r'mpl-data', [r'C:\Python27\Lib\site-packages\matplotlib\mpl-data\matplotlibrc']),
              (r'mpl-data\images',glob.glob(r'C:\Python27\Lib\site-packages\matplotlib\mpl-        data\images\*.*')),
              (r'mpl-data\fonts',glob.glob(r'C:\Python27\Lib\site-packages\matplotlib\mpl-        data\fonts\*.*'))],


#matplotlib.get_py2exe_datafiles(),

options={ 
    'py2exe':{ 
        'includes': [ 
            'matplotlib',
            'matplotlib.backends.backend_wx',
            'matplotlib.pyplot',
            'mpl_toolkits.basemap',
            'matplotlib.figure',
            'numpy.random',
            'wx.calendar',
            'mpl_toolkits', 
            'numpy', 
            'datetime', 
            'wx', 
            'pylab', 
            'adodbapi', 
            'sqlparse',
            'annote_new',
            'cPickle', 
            'pylab' 
        ], 
        'dll_excludes': ['MSVCP90.dll'],  
    } 
},


) 

Any thoughts on why my modules aren’t importing after I run the py2exe? BTW, I get no errors when running the py2exe code — only when i try to run the produced executable. Thanks!

EDIT

Okay, here is what i have done. I have taken out some of the modules that I weren’t using and removed the duplicates. I also fixey my setup.py file to look like:

from distutils.core import setup 
import py2exe
import matplotlib
import glob

setup( 

windows=[{'script': r'Scout_Tool.py'}], 

data_files = matplotlib.get_py2exe_datafiles(),

options={ 
        'py2exe':{ 
            'includes': [ 
                'matplotlib',
                'matplotlib.backends.backend_wx',
                'matplotlib.pyplot',
                'mpl_toolkits.basemap',
                'matplotlib.figure',
                'wx.calendar',
                'mpl_toolkits', 
                'datetime', 
                'wx', 
                'adodbapi', 
                'sqlparse',
                'annote_new',
                'cPickle', 
                'pylab' 
            ], 

        } 
    },


) 

After this, I cleared out my entire ‘dist’ folder to be sure anything wasn’t kept from before. Then I ran the following in CMD Prompt: C:\Python27\python setup.py py2exe. This ran with no errors.

Then when i go to run Scout_Tool.exe, I first get a MatPlotLib data error. I am not sure why i am getting this, but to fix it, I do the following: I unzip “library.zip”, then add the “data” folder from Mpl-toolkits – basemap – data, then re-zip the library folder.

Then, when I try running Scout_Tool.exe, it comes up with the error that “No module named os” exists. This is true if I put any module first in my Scout_Tool.py code.

Hopefully this helps with where i am at? 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-06-06T18:33:26+00:00Added an answer on June 6, 2026 at 6:33 pm

    I compiled your program (the imports) and it runs OK for me.
    the py2exe missed module report is not relevant if you are not using those modules (I got the same list as that you show).

    Remember that the executable will run while you execute it within the dist module py2exe creates (and not from a copy in your desktop, for example. For that you need to make a direct access link).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Best way to stop SQL Injection in PHP I am creating a
Possible Duplicate: oracle PL/SQL: sort rows I run this query: Select a.product, sum( case
Possible Duplicate: how to use foursquare API in android application? This is a question
Possible Duplicate: How to rename java.exe/javaw.exe process? Hi, I am working on java desktop
Possible Duplicate: Is there any way to clone a git repository’s sub-directory only? clone
Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an
Possible Duplicate: Finding the Variable Name passed to a Function in C# In C#,
Possible Duplicate: Where do the Python unit tests go? Are unit tests kept in
Possible Duplicate: Hibernate and no PK Anyone knows how to do hibernate mapping for
Possible Duplicate: How does an underscore in front of a variable in a cocoa

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.