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 8937635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:26:54+00:00 2026-06-15T10:26:54+00:00

I have a problem when preparing an .exe for my app using py2exe. The

  • 0

I have a problem when preparing an .exe for my app using py2exe.
The source of this problem is the following function that I created to use classes from
a dynamically defined module.

def of_import(module, classname, country = None):
    '''
    Returns country specific class found in country module
    '''
    if country is None:
       country = CONF.get('simulation', 'country')
    _temp = __import__(country + '.' + module, 
                       globals = globals(), 
                       locals = locals(), 
                       fromlist = [classname], 
                       level=-1)
    return getattr(_temp, classname, None)

When I try to load some class using:

self.InputTable = of_import('model.data', 'InputTable')

I end up with the following error when running the .exe:

File "core\utils.pyc", line 900, in of_import
ImportError: No module named france.model.data

I should precise that the france.model.data.py do exist.

What would be the appropriate way to deal with this issue ?

For information here is the link to the setup file : https://github.com/openfisca/openfisca/blob/dev/src/setup_x64.py

  • 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-15T10:26:55+00:00Added an answer on June 15, 2026 at 10:26 am

    I have a similar setup

    Make sure you add your dynamic modules in the “packages” section of py2exe

    setup(windows=[{
                    "script" : "openFisca.pyw"
                    }], 
          options={"py2exe" : {"includes" : ["sip", "encodings.*", "numpy.*"],
                               "packages": ["france","tunisia"],
                               "dist_dir": dist_dir,
                               "bundle_files":3,
                               "dll_excludes": ["MSVCP90.dll"]
                               }}, 
          data_files=data_files)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with my query on C, I’m using the oci8 driver. This
I have a problem tring to write to a binary file. //This is preparing
I have a bunch of diagrams created using a Java diagramming tool that I
I am preparing app using phonegap.In app i have displayed list of data and
Preparing for exam I have a problem with the following exercise: How many undirected
Possible Duplicate: Using IoC for Unit Testing I think I do have a Problem
I'm preparing my paypal system and have a separate page that forwards the user
I am preparing a registration page using JSF/Spring webflow&mvc application. I have added two
I came across this problem while preparing for an interview and curious to know
I'm preparing to embark on a web app development that will make little to

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.