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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:51:44+00:00 2026-05-27T10:51:44+00:00

I have a system python installation and a personal python installation in my home

  • 0

I have a system python installation and a personal python installation in my home directory. My personal python comes in ahead in my $PATH and I usually run that. But the system python installation has some modules that I want to use with my personal python installation.

So, basically, I want to append the sys.path of the system python installation to the sys.path of the personal python installation.

I read up on the docs and source of site module and saw that I could use the sitecustomize or usercustomize modules to do this. But where I am stuck is how do I get the sys.path of the system python to be appended to the personal python’s sys.path.

The gensitepackages function in the site modules seems to calculate the paths to be added to sys.path but it is using the PREFIXES global variable instead of taking it as an argument, so for all I know, I can’t use it. Adding system python’s prefixes to PREFIXES is also not an option as by the time the customize module(s) are loaded, the PREFIXES is already used to build the path.

Any ideas on how to go about this?

Also, I’m not sure if I should ask this on askubuntu/unix&linux. Comments?

Edit: Guess I wasn’t clear on this part. I want the system python’s path to be appended so that when I try to use modules that are not present in my personal python, it will automatically fallback to the system python’s modules.

  • 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-27T10:51:44+00:00Added an answer on May 27, 2026 at 10:51 am

    Either set the PYTHONPATH environment variable or, in your personal Python installation’s site-packages directory, add one or more path configuration files (.pth files) that point to the directories you want to add from the system Python installation.

    UPDATE: In general, it’s not a good idea to mix modules from different Python instances. For instance, there could be differences in the configure parameters used to build the two Python that could produce incompatibilities in C extension modules built for the existing system Python but used with your personal Python. But, if you really want to go down this path, you could manipulate the path with .pth files or modify the site module. Or what might be a more-straightforward and easier-to-manage approach is to use virtualenv to create a private virtual environment using the system Python but then replace the interpreter in the environment; see, for example, the section Using Virtualenv without bin/python.

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

Sidebar

Related Questions

In a Python system for which I develop, we usually have this module structure.
I have a system currently written in Python that can be separated into backend
I have a Python module installed on my system and I'd like to be
With python inotifyx, do I have to remove watch and close opened system file
I have to write a reliable, totally-ordered multicast system from scratch in Python. I
We have system here that uses Java JNI to call a function in a
I have a system that combines the best and worst of Java and PHP.
I have python .egg files that are stored in a relative location to some
We have a common python installation for all of our systems in order to
Pythons installed under WinXP have dirs like DLLs, DOC, include, etc. but python (2.5)

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.