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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:08:05+00:00 2026-05-17T15:08:05+00:00

I’m trying to compile a simple Python program, that uploads files to an S3

  • 0

I’m trying to compile a simple Python program, that uploads files to an S3 bucket using the boto package, in to a single, redistributable .exe file. I’m open to any compilation method. So far I’ve tried both bbfreeze and py2exe and both yield the same results. The code in question that causes trouble looks like this:

import boto
#...snip...
fname_base = os.path.basename(fname)
s3 = boto.connect_s3(aws_access_key_id=_aws_key, aws_secret_access_key=_aws_secret_key, is_secure=False);
bucket = s3.get_bucket(_bucket)
key = bucket.new_key(fname_base)
key.set_contents_from_filename(fname)

Compiled with either executable bundling utility and run I get:

Traceback (most recent call last):
  File "s3stash.py", line 238, in <module>
    sys.exit(main())
  File "s3stash.py", line 225, in main
    push_file_to_s3(f, options)
  File "s3stash.py", line 160, in push_file_to_s3
    _push_with_boto(fname)
  File "s3stash.py", line 148, in _push_with_boto
    s3 = boto.connect_s3(aws_access_key_id=_aws_key, aws_secret_access_key=_aws_secret_key, is_secure=False);
  File "boto\__init__.pyo", line 104, in connect_s3
  File "zipextimporter.pyo", line 82, in load_module
  File "boto\s3\connection.pyo", line 27, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "boto\utils.pyo", line 55, in <module>
  File "email\__init__.pyo", line 79, in __getattr__
ImportError: No module named multipart

I’m using ActiveState Python 2.6 on Windows XP SP3. The boto package was installed with:

easy_installer --always-unzip boto

I used the --always-unzip option based on the information found here about py2exe having issues with the egg files that were unpacked. Unfortunately the error I get is the same when I use bb-freeze to build the executable.

The output from py2exe includes, near the end, the following bit of information:

The following modules appear to be missing
['_scproxy', 'email.Encoders', 'email.MIMEBase', 'email.MIMEMultipart', 'email.MIMEText', 'email.Utils', 'simplejson']

Which lends some hints. I tried methods suggested in other posts to SO where the -i option was recommended when compiling with py2exe and unfortunately nothing helped. In those other questions the users were doing their own explicit inclusion of of the email sub-modules. I could not figure how to adapt those solutions to my case unfortunately and just adding them with -i didn’t stop py2exe from warning me of the missing modules, or the resulting bundled exe from failing with the missing module error.

Can someone help me get this code bundled for redistribution?

  • 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-17T15:08:06+00:00Added an answer on May 17, 2026 at 3:08 pm

    I actually got this to work. The answer was to ditch boto and use the poster library instead. I still use boto to generate a signed policy and the necessary form fields for POST I do via poster, but the actual executable that does the POST only includes poster now. With just poster in the mix, py2exe doesn’t have any issues creating a standalone executable for me for redistribution.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and

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.