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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:00:44+00:00 2026-06-03T06:00:44+00:00

I want to create a setup.py which would install my files into custom directories.

  • 0

I want to create a setup.py which would install my files into custom directories. I have a certain prefix, where I would like to get the following result:

/my/prefix/
  bin/
    script.sh
  libexec/
    one.py
    two.py
    ...
  lib/pythonX.Y/site-packages/
    package/...

My initial project is following:

/
  script.sh
  one.py
  two.py
  ...
  setup.py
  package/...
    __init__.py
    ...

What would be the best way to achieve that? I would like to be able to install it later with something like:

python setup.py install --prefix=/my/prefix

I can get "package" nicely installed in the correct directory as lib/pythonX.Y/site-packages under --prefix is the default location. But is there a clean way to get script.sh into "bin" and other python files into "libexec"? The only way I see to achieve that would be to manually copy those files in my setup.py script. Maybe there is a cleaner and more standard way to do that?

  • 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-03T06:00:46+00:00Added an answer on June 3, 2026 at 6:00 am

    The scripts are handled by use of the scripts parameter to the setup function. For libexec you can treat them as data files and use a data options.

    setup(...
        scripts=glob("bin/*"),
        data_files=[(os.path.join(sys.prefix, 'libexec', 'mypackage'), glob("libexec/*"))],
        ...
    )
    

    I’m not sure how that would work with a --prefix option, I’ve never tried that.

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

Sidebar

Related Questions

I want to create a installer which would just dump few files and folders
I have created a package which contains following files to install a package. setup.exe
So, here is the scenario: I want to create a installer which would just
We have our custom setup.exe program which launches a series of individial MSIs in
I have some documents I want to install (using the Setup project) onto a
I have some jquery-scripts which I want to put into a plugin. In my
I want to create endpoints that can be local in one setup and remote
i want create image animation , i have 50 images with png format now
I want create module which update list of usb devices automatically (not only mass
I want to create a textbox which text binds an integer (e.g 123456789), but

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.