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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:29:01+00:00 2026-06-01T13:29:01+00:00

I have written my program in python. It is written across seven files and

  • 0

I have written my program in python. It is written across seven files and in three of the files I import a custom package. The thing is I cant build my program into an exe. I have tried pyinstaller 1.5.1 and py2exe. I have followed every tutorial I could find but with no success. Every time I have tried when I go to run the exe created I get an error message saying it cannot find my custom package. I think I have just not been able to get the complete package to be built into the exe. Please help.

from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')

mfcfiles = [os.path.join(mfcdir, i) for i in ["mfc90.dll", "mfc90u.dll", "mfcm90.dll", "mfcm90u.dll", "Microsoft.VC90.MFC.manifest"]]

data_files = [("Microsoft.VC90.MFC", mfcfiles),]

setup(
    data_files = data_files,
    options = {'py2exe': {'optimize': 2}},
    windows = [{'script': "LoadFilesGUI.py"}],
    zipfile = "shared.lib",
)

another:

from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

setup(
    options = {'py2exe': {'optimize': 2}},
    windows = [{'script': "LoadFilesGUI.py"}],
    zipfile = None,
    console=['LoadFilesGUI.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-01T13:29:04+00:00Added an answer on June 1, 2026 at 1:29 pm

    By “custom package”, I am assuming you mean your custom python modules that make up your application. I might suggest trying to use the “includes” option of the setup() call to manually specify the python modules that should be included, in case they are not discovered automatically:

    setup( 
        windows = [{'script': "LoadFilesGUI.py"}], 
        data_files = data_files, 
        zipfile = None, 
        options = {
            'py2exe': {
                'optimize': 2, 
                'bundle_files': 1,
                'includes' : [],
            }
        }, 
    ) 
    

    For instance, in my project which uses PyQt4, my includes looks like this:

    options={ 
        "py2exe": { 
            "includes" : ['sip','PyQt4.QtCore','PyQt4.QtGui',
                            'PyQt4.QtNetwork','PyQt4.QtWebKit'] 
        } 
    }
    

    The rest of your setup.py script seems to be pretty standard. Make sure that your included modules are part of your PYTHONPATH, either being relative to your project, or explicitly added to the path.

    If, as you have stated in your comments, MyPackage is a package within your project, then you would want: 'includes' : ['MyPackage']

    If this still gives you errors, then the problem could be with the structure of your project and package, or again, with your PYTHONPATH

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

Sidebar

Related Questions

I have written a Python program to find the carrier of a cell phone
Well, i have written a simple python program that parses HTML with HTMLParser. Here
I have written a program in Tkinter (Python 2.7), a scrabblehelper in Norwegian which
I have written a simple python program l=[1,2,3,0,0,1] for i in range(0,len(l)): if l[i]==0:
I am an intermediate level Python Programmer and I have written a Python program
Basically I have written two modules for my Python Program. I need one module
I have written a small C program that embeds Python. I'm setting it up
I have a command line program written in Python, and when I pipe it
I need to import the readline functionality in a program written in python. I
I have a written a program in Python 3 and are using Sphinx 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.