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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:12:34+00:00 2026-05-31T09:12:34+00:00

I am trying to compile a simple script I wrote using Python3 and PyQt4

  • 0

I am trying to compile a simple script I wrote using Python3 and PyQt4 using cx_Freeze, but I’ve got three problems that I just can’t figure out.

  1. I cannot get the icons to appear. I am using a compiled resource file for it, i.e. importing a .py containing the resources, and I have tried to follow the advice here, copying the imageformats folder to my project folder but nothing seems to work.

  2. I am not using severl python modules including tcl and ttk so I added them to the excludes option. However, they still seem to be added.

  3. When I try to compile with base='Win32GUI' running the created exe raises an exception: 'NoneType' has no attribute 'encoding'

I’m pretty sure that there is just something wrong with my setup script since the cx_Freeze documentation is not very verbose, so hopefully someone can point out the problem. Here is the setup script. I’m not going to post the script I’m compiling because its quite long, but if its needed I’ll try to create a concise version for testing.

from cx_Freeze import setup, Executable

exe = Executable(
    script='cconvert.py',
    base='Win32GUI'
)

options = dict(
    excludes=['curses', 'email', 'tcl', 'ttk']
)

setup(
    name="Coord Convertor",
    version="0.1",
    description="A Coordinate converter from DMS to DD",
    requires=['pyqt4 (>=4.8)', 'dtlibs (>=0.4.1)'],
    data_files=['imageformats'],
    executables=[exe],
    options={'build-exe': options}
)
  • 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-31T09:12:36+00:00Added an answer on May 31, 2026 at 9:12 am

    (Note sure about 1.)

    2: In options={‘build-exe’…, I think it needs to be build_exe (underscore instead of dash).

    3: Are you trying to access something like sys.stdout.encoding anywhere? sys.stdout will be None when you use the Win32GUI base. Even a print() call might trigger that.

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

Sidebar

Related Questions

I'm trying to create a simple form that adds a user new User(). But
I am trying to cross-compile a very simple program for Android that worked with
I'm trying to compile a very simple program that makes a connection to a
I'm trying to compile a simple program, with #include <gtkmm.h> The path to gtkmm.h
I'm trying to compile a simple example of generic classes / type patterns (see
i am trying to compile this very simple piece of code class myList {
I'm trying to compile the following simple DL library example code from Program-Library-HOWTO with
I am trying to compile and run a simple java class within eclipse. The
When trying to compile a file that include winnt.h via windows.h, I get the
While trying to compile a 64 bit linux kernel using gcc, I see the

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.