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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:46:57+00:00 2026-05-31T20:46:57+00:00

My build is structured like: SConstruct subdir/SConscript subdir/module/__init__.py SConstruct invokes subdir/SConscript as a subsidiary:

  • 0

My build is structured like:

SConstruct
subdir/SConscript
subdir/module/__init__.py

SConstruct invokes subdir/SConscript as a subsidiary:

# SConstruct
SConscript('subdir/SConscript')

subdir/SConscript imports module:

# subdir/SConscript
from module import foo
do SConsy stuff with foo()...

This works fine until I use variant_dir with subdir/SConscript:

# SConstruct
SConscript('subdir/SConscript', variant_dir='subdir/build', duplicate=0)

The problem is that the import fails because module is no longer in the path, which has been altered by variant_dir.

Is there a standard way to solve this problem in either SCons or Python? I know about the special site_scons directory, but it appears that this directory must exist at the top level with the root SConstruct, and I’d like to keep subdir-specific files under subdir.

  • 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-31T20:46:58+00:00Added an answer on May 31, 2026 at 8:46 pm

    Use site_scons dir in project root dir for you module. For example i’ve module xxx, and he is placed : root/site_scons/xxx/__init__.py. Now, i can import xxx in all of my SConscript files.

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

Sidebar

Related Questions

I'm porting an existing system from Windows to Linux. The build is structured with
I'm trying to build an array structured like [ [num, [num, num num]], [num,
I'm looking to build a tree-like structure for my Java application. I've tried using
If we've learned anything from HTML/CSS it's that, declarative languages (like XML) do a
I have 2 tables: posts tags Tags table is structured like this: post_id tag
I am trying to build MySQL's Connector/C from source in cygwin and there are
I want to build a relation like this ( a Zone is in the
I'm currently working on a web project that involves several assemblies, structured something like
We'd like to build a custom type - or simply add custom columns to
I would like to have a tools repository structured like so: tools |-- gnu

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.