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

  • Home
  • SEARCH
  • 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 8271713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:55:02+00:00 2026-06-08T06:55:02+00:00

My first attempt at using python setuptools. I am using wxPython in the project.

  • 0

My first attempt at using python setuptools. I am using wxPython in the project. I am using the following import lines

import wx, random
from wx.lib import buttons

And in my setup.py I have

 setup(
      name='name',
      version='0.2p',
      description='...',
      author='...',
      author_email='...',
      packages=['name'],
        long_description=open(
          path.join(
              path.dirname(__file__),
              'README'
          )
      ).read(),
        install_requires=[
          'setuptools',
          'MySQL-python',
          'wx',
          'ObjectListView'
        ],)

When I use easy_install on the .egg everything seems fine. But when I run the main method from where the project has been installed, I get the failed import message:

from wx.lib import buttons
ImportError: No module named lib

Do I need to explicity require the wx.lib module in the setup.py file?

  • 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-08T06:55:04+00:00Added an answer on June 8, 2026 at 6:55 am

    The problem has nothing to do with your setup.py file, rather you’re missing a step in your import statements. You need to explicitly import the lib module from wx. It should look something like this:

    import wx
    import wx.lib
    from wx.lib import buttons
    

    Edit: Actually, there is a problem with the setup.py install_requires. You want to require wxPython and NOT wx. wx is an entirely different package in Python’s package index.

    You do still need that extra import wx.lib in your import statements however.

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

Sidebar

Related Questions

The following code (without showing it all) is my first attempt at using classes.
Although I am not new to Python, this is my first attempt at using
Here's my simple first attempt at a python extension using boost. Can someone help
First day and first attempt at using Scala - so go easy on me!
this if my first attempt at using streaming for WCF, and I am struggling
I'm writing an application using DDD techniques. This is my first attempt at a
I am using -drawRect for the first time in an attempt to alternatively speed
I'm trying to screenscrape the first result of a Google search using Python and
My team is on our first attempt at using NServiceBus (v2.0), using MSMQ as
This is my first attempt at using BufferStrategy and I'd really appreciate some hints.

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.