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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:29:20+00:00 2026-06-14T05:29:20+00:00

How to Change dependency paths and deploy to different directory structure than developing in?

  • 0

How to Change dependency paths and deploy to different directory structure than developing in?

I have a the following structure in my source directory

\ABCE
\ABCE\lib
\ABCE\lib\modulA.py
\ABCE\lib\modulA.py

if I now package with python setup.py sdist

i need to call the module with:

import lib.moduleA
import lib.moduleB

how can I avoid lib. but maintain my directory structure? So that I import with

import moduleA
import moduleB
  • 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-14T05:29:21+00:00Added an answer on June 14, 2026 at 5:29 am

    List lib in the packages_dir option:

    package_dir = {'': 'lib'}
    

    From the distutils “Writing a Setup Script” documentation:

    If you use a different convention to lay out your source directory, that’s no problem: you just have to supply the package_dir option to tell the Distutils about your convention. For example, say you keep all Python source under lib, so that modules in the “root package” (i.e., not in any package at all) are in lib, modules in the foo package are in lib/foo, and so forth. Then you would put

    package_dir = {'': 'lib'}
    

    in your setup script. The keys to this dictionary are package names, and an empty package name stands for the root package. The values are directory names relative to your distribution root. In this case, when you say packages = ['foo'], you are promising that the file lib/foo/__init__.py exists.

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

Sidebar

Related Questions

Change all links that have an image in it to: javascript(alert(thehref)); eg. <a href=/galleries/anna-leah-111827/image01.html><img
To change Proxy server I have to go to IE->Internet Options->LAN Settings and click
I change schema.yml from time to time and execute: symfony propel:build-all-load but the lib/_model
How change int value in block, I have this : __block long long size
In a WPF UI I have nodes connected by bezier paths, like so: It
I created a custom behavior that exposes some custom dependency properties whose values change
I'm doing some tests with Spring 2.0.8. I've the following problem, all the source
I have a master project that's using a fairly standard source tree approach +
I have a pretty large system to deploy, plenty of components and built to
I'm currently trying RequireJS 2.0 and consequently have to change some code. Here's my

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.