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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:36:45+00:00 2026-06-09T03:36:45+00:00

My question assumes you are using the same python versions on those different linux

  • 0

My question assumes you are using the same python versions on those different linux distributions. I also exclude virtual environments from my question.

I use the Debian based distribution Ubuntu. There the path to the python standard library (the modules/packages written in python) is /usr/lib/python2.7. The path to “external” python packages is /usr/local/lib/python2.7/dist-packages.

A system independent way to get these paths is greatly appreciated.

Edit1

I found:

>>> from distutils.sysconfig import get_python_lib
>>> print get_python_lib()
/usr/local/lib/python2.7/dist-packages

and

>>> print get_python_lib(standard_lib=True)
/usr/lib/python2.7

Edit2

I think the approach in the first edit is deprecated since I can only find this up and untill the python2.5 docs. The new approach (in 2.7 docs):

>>> import sysconfig
>>> sysconfig.get_path_names()
('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', 'scripts', 'data')
>>> print sysconfig.get_path('platlib')
/usr/local/lib/python2.7/dist-packages

I haven’t found yet how to find /usr/lib/python2.7 with sysconfig. For now I’ll work with the deprecated approach and proceed under the assumption that this yields the desired results.

  • 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-09T03:36:47+00:00Added an answer on June 9, 2026 at 3:36 am

    Yes it’s different, in CentOS 5.6, for example, python external modules are placed in /usr/lib/python2.6/site-packages. Actually dist-packages is debian specific directory.

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

Sidebar

Related Questions

My question is essentially the same as this one here . I'm using AnkhSVN
I can see from this question Why are session methods unbound in sqlalchemy using
This question assumes there's a blessed central repository that members of a team clone
My question assumes simple inserts into a table with no relevant relations. // various
I've been using jedie's python ping implementation on Windows. I could be wrong, but
I have seen this question and a number of blog posts related to using
I am developing web app on flask, python, sqlalchemy and postgresql. My question is
This question assumes familiarity with FormStack , a drag-and-drop WYSIWYG online form builder. Background
I am starting to read about Trie. I got also references from friends here
This is a follow up to my previous question . I am using the

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.