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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:17:32+00:00 2026-06-13T01:17:32+00:00

Inside the setup.py script I need to create some temporary files for the installation.

  • 0

Inside the setup.py script I need to create some temporary files for the installation. The natural place to put them would be the “build/” directory.

Is there a way to retrieve its path that works if installing via pypi, from source, easy_install, pip, …?

Thanks a lot!

  • 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-13T01:17:36+00:00Added an answer on June 13, 2026 at 1:17 am

    By default distutils create build/ in current working dir, but it can be changed by argument --build-base. Seems like distutils parses it when executing setup and parsed argument does not accessible from outside, but you can cut it yourself:

    import sys
    build_base_long = [arg[12:].strip("= ") for arg in sys.argv if arg.startswith("--build-base")]
    build_base_short = [arg[2:].strip(" ") for arg in sys.argv if arg.startswith("-b")]
    build_base_arg = build_base_long or build_base_short
    if build_base_arg:
        build_base = build_base_arg[0]
    else:
        build_base = "."
    

    This naive version of parser still shorter than optparse‘s version with proper error handling for unknown flags. Also you can use argparse‘s parser, which have try_parse method.

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

Sidebar

Related Questions

I have a search setup inside a div but for some reason cannot get
I want to show some web page INSIDE Inno Setup installer page, how can
I need to find a way to reference environment variables INSIDE the Inno Setup
I need to build an add-on using Setup Project in VS 2010. The setup
Setup: I have a UITextView inside a UITableViewCell 's contentView . I want it
I wanted to setup a cron job inside my module. I followed the instructions
Setup: I have a COM DLL that calls a method inside a managed C#
In my project, have setup an admin panel under a folder inside controllers folder
Bit of an unusual question, but I have setup a field inside a MySQL
I build an installer with Basic MSI Project in InstallShield 2010. My setup has

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.