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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:29:50+00:00 2026-06-08T10:29:50+00:00

I am trying to learn Python by myself using Zed A.Shaw’s book Learn Python

  • 0

I am trying to learn Python by myself using Zed A.Shaw’s book Learn Python the hard way.
At exercise 46. I’am supposed to create a project skeleton (i.e. create a setup.py file, create modules, and so). Then make a project.

I have to put a script in my bin directory that is runnable for my system. I wrote the simple Hello World! script turned it into an .exe file using cxfreeze.

However when I try to install my setup.py file (i.e. By typing python setup.py install in the cmd), I can’t install this .exe file instead I can only install the script script.py
How can I install this exe file.
This is my setup.py file:

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

config = {
    'description':  'First project',#ex46
    'author':  'author',#
    'url':  '',#N/A
    'download_url':  '',#N/A
    "author_email":  "author_email@email.com"
    'versio':  '3.1',
    'install_requires': ['nose'],
    'packages': ['skeleton\quiz46','skeleton\\tests'],
    'scripts':  ['skeleton\\bin\helloscript.py','skeleton\\bin\helloscript.exe'],
    'name':  'quiz46'
}

But this gives me the following error:

UnicodeDecodeError

I have also tried putting skeleton\bin\helloscript.exe but that gives me a similiar Error!

My OS is Windows 7, and I am using Python 3.1.

Again what I want is for the setup.py to install my .exe file too not just it’s script.

  • 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-08T10:29:53+00:00Added an answer on June 8, 2026 at 10:29 am

    I don’t think the script option is meant to handle anything but text files. If you have a look at the source code for distribute (aka setuptools), the write_script command will try to encode('ascii') the contents if it’s anything other than a python script AND if you are using Python 3. Your cxfreeze exe is a binary file, not a text file, and is likely causing this to choke.

    The easier option to get setuptools to include a executable script in the installation process is to use the entry_points option in your setup.py rather than scripts:

    entry_points={'console_scripts':['helloscript = helloscript:main'] }
    

    The console_script will automatically wrap your original helloscript.py script and create an exe (on Windows) and install it into your Python’s Script directory. No need to use something like cxfreeze.

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

Sidebar

Related Questions

I am trying to complete Exercise 47 of Learn Python The Hard Way, 2nd
I'm trying to learn python. I am using 3.1.2 and the o'reilly book is
I'm trying to learn Python with the help of Learning Python the Hard Way.
So I'm trying to learn Python using some tutorials, and I decided to create
I'm trying to teach myself python right now, and I'm using exercises from Learn
I'm trying to work my way through Learn Python the Hard Way, and trying
Python noob trying to learn Pylons. I'm using the QuickWiki tutorial ( http://pylonshq.com/docs/en/1.0/tutorials/quickwiki_tutorial/ )
I'm a born again amateur programming novice trying to learn Python 3 (3.2) using
first question here. I am trying to learn python by stepping through project euler,
I've been trying to learn Python, and while I'm enthusiastic about using closures in

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.