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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:07:21+00:00 2026-06-15T08:07:21+00:00

Im trying to add some libraries within my app to make it more portable.

  • 0

Im trying to add some libraries within my app to make it more portable.
The problem is that the app is built with not this in mind.

So to be more specific I want to have a folder in my package called libs and keep a copy of the libs used in my app there.

For example lets say I use MySQLdb library. In my app I am importing it like this

import mysqldb

I want to be able to use the same code but having mysqldb inside libs folder.

Is that possible? I tried some things with __init__.py but I failed.

  • 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-15T08:07:23+00:00Added an answer on June 15, 2026 at 8:07 am

    You can just play around with sys.path and should achieve what you want. Just do at the beginning of your program:

    import sys
    sys.path = [$'path_to_your_lib_folder_here'$] + sys.path
    

    This is not a best practice however and you need to be carefull especially if your software will be used as a third-party by other libraries.

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

Sidebar

Related Questions

I am trying to add some logic in this. But I am not sure
I am trying to add some error detection to a script that is used
I'm trying to add some navigation controller in my app, it's sth likes: in
Im trying to add some short file names to a Wise installer to fix
I was trying to add some non-production test code by creating a 3rd partial
I am trying to add some WebAPI support to my asp.net 4 RC site,
I'm trying to add some functionality to dunst, a small notification system. I've never
I am trying to add some views programatically to a linear layout which is
I am trying to add some functionality to json processing for some nodes. So
I'm trying to add some accessibility for screen readers into a Flash application, and

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.