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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:30:44+00:00 2026-05-29T22:30:44+00:00

I want to replace libsqlite3 with the special version for Python. I have a

  • 0

I want to replace libsqlite3 with the special version for Python.
I have a special version of libsqlite3.so.0 /path/to/libsqlite3.so.0 and configured LD_LIBRARY_PATH.
However, python’s internal will not load it.

I checked and noticed the following:

  1. import sqlite3 loads python’s original /usr/lib/python2.7/sqlite/__init__.py and dbapi2.py.
  2. dbapi2.py imports _sqlite, and this indicates /usr/lib/python2.7//lib-dynload/_sqlite3.so.
  3. _sqlite3.so always loads /usr/lib/i386-linux-gnu/libsqlite3.so.0, in spite of setting LD_LIBRARY_PATH.
  4. If I copy libpthread.so.0 to /path/to/libpthread.so.0, _sqlite3.so loads it. So, /path/to/libpthread.so.0 is loaded but /path/to/libsqlite3.so.0 is not loaded.

I want to know how to load /path/to/libsqlite3.so.0, a special version, without replacing /usr/lib/i386-linux-gnu/libsqlite3.so.0 (only with non-privileged permission).

  • 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-29T22:30:45+00:00Added an answer on May 29, 2026 at 10:30 pm

    You might try to force loading of the lib with:

    LD_PRELOAD=/path/to/libsqlite3.so.0 python ...
    

    The library will be loaded in memory when python will be executed. So normally when _sqlite3 module will be imported, it will not load libsqlite3.so.0, and use the version already preloaded in memory.

    Edit

    The LD_LIBRARY_PATH doesn’t work in that case cause libsqlite3.so.0 is loaded by _sqlite.so module, loaded by dlopen() within Python. In that case, the manpage of dlopen() said that the order is:

    1. (ELF only) If the executable file for the calling program contains a DT_RPATH tag, and does not contain a DT_RUNPATH tag, then the directories listed in the DT_RPATH tag are searched.

    2. If, at the time that the program was started, the environment variable LD_LIBRARY_PATH was defined to contain a colon-separated list of directories, then these are searched. (As a security measure this variable is ignored for set-user-ID and set-group-ID programs.)

    3. …

    So if an DT_RPATH is set on the binary, it will be taken prior to your LD_LIBRARY_PATH.

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

Sidebar

Related Questions

I want to replace single quote (') in a string. Apparently this will not
I want to replace characters at the end of a python string. I have
I want to replace any twitter @UserName with a {UserName}. I now have the
I have this code, and I want to know, if I can replace only
I want to replace ! = change @ = static(does not) $ = Want
I want to replace a word that is in html content (not attributes) and
I want to replace some HTML tags that I have in a CDATA element,
i have the following code.My table is called 'tableu'.I want replace 'tableu' with a
I want to replace the next expression with something simpler but i'm not sure
I want to replace the 'client' field text box in fogbugz when you edit

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.