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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:04:32+00:00 2026-06-18T19:04:32+00:00

The setup.py file in a package I maintain, uses code from another package to

  • 0

The setup.py file in a package I maintain, uses code from another package to build extensions:

from setuptools import setup, find_packages
from mydependence import build_ext
...
setup(
    name='mypackage',
    version='1.0.0',
    ...
    setup_requires = [
      'mydependence', # is this being checked properly?
    ],
    ...
    install_requires = [
      'mydependence',
    ],
    ...
    )

I would like to build the current package with zc.buildout, so I create a simple buildout.cfg file like:

[buildout]
parts = python
eggs = mypackage

[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}

Unfortunately that does not work as I expect – as I execute ./bin/buildout and setup.py is read, it complains mydependence is not found. When buildout runs my setup.py, its sys.path has no knowledge of packages installed under the directory eggs (except for setuptools itself!). Apparently, packages in “eggs” and “develop-eggs” are not included in ./bin/buildout‘s paths while it runs the package’s setup.py.

The question: how to make that work?

  • 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-18T19:04:34+00:00Added an answer on June 18, 2026 at 7:04 pm

    The basic problem is that you’re already importing from mydependence before you’re calling the setup() method. I can see no way in which setuptools (or buildout for that matter) can ignore the ImportError you will get.

    If I look at some example code from, for instance, http://pythonhosted.org/py2app/examples.html I see code like this:

    from setuptools import setup
    setup(
        app=["MyApplication.py"],
        setup_requires=["py2app"],
    )
    

    Note that there’s no import of py2app. So setup_requires apparently is a way to load “extensions” to the basic setuptools functionality. It is not a way to circumvent basic python import errors.

    Update: see comment below by @MartijnPieters who has a solution in https://stackoverflow.com/a/12061891/27401 .

    Martijn’s example would look like this in your case:

    import setuptools
    
    setuptools.dist.Distribution(dict(setup_requires='mydependence'))
    # `setup_requires` is parsed and acted upon immediately; 
    # from here on out the package `mydependence` is installed
    # and importable.
    
    from mydependence import build_ext
    
    setup(
        ...
        install_requires = [
          'mydependence',
        ],
        ....
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have basically the following setup in my package: thing.py: from otherthing import *
The encoding package uses HaXml in its build script (in Setup.hs ). It happens
I'm trying to setup a build file and I was curious if you can
I maintain a few Python packages. I have a very similar setup.py file for
I've got a Visual Studio Setup Project that uses the msiexec.exe file to create
i'm using vs installer to build a setup package for my vb6 app. and
I have setup file of winform. but i want to change my icon how
I have a php file setup to pull through ONE XML data feed, What
I have a ubr file setup to stress test an internal DotNetNuke site with
Can i create 64-bit setup.exe file using InstallScript project in InstallShield 2009? Documentation is

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.