Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between /usr/lib/python and /usr/lib64/python?

Tags:

python

I was using ubuntu.

I found that many Python libraries installed went in both /usr/lib/python and /usr/lib64/python.

When I print a module object, the module path showed that the module lived in /usr/lib/python.

Why do we need the /usr/lib64/python directory then? What's the difference between these two directories?

BTW

Some package management script and egg-info that lived in both directories are actually links to packages in /usr/share.

Most Python modules are just links, but the so files are not.

like image 849
satoru Avatar asked Jul 06 '12 23:07

satoru


People also ask

What is the difference between LIB and lib64 in Linux?

/usr/lib64 is for 64-bit libraries. /usr/lib is for 32-bit compatibility libraries.

What is in usr lib64?

Purpose. /usr/lib includes object files and libraries. On some systems, it may also include internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/lib .

What is the difference between usr local lib and usr lib?

For the question in the topic: /usr/local/lib is meant for libs that you installed (compiled) yourself. /usr/lib is for libraries your distribution provides. You might want to read about the Filesystem Hierarchy Standard (FHS) for more info.


1 Answers

Debian (and probably it's derivatives, most notably ubuntu) uses /usr/lib for both architectures. /usr/lib64 is provided as a symlink to /usr/lib for compatibility reasons. Some newer applications might be looking in /usr/lib64 for libraries, while some legacy code might be using /usr/lib. Other distributions can provide multi-architecture support, having 32 bit and 64 bit libraries installed on the same machine, which would then be placed in /usr/lib and /usr/lib64 accordingly. An example of this would be Arch Linux, as described here.

Some python libraries are platform independent anyway (.py code), so it makes sense to create a single package for both architecture to minimize maintenance effort. This package would then install itself in both lib and lib64, or, as you pointed out already, in one single directory that is symlinked to from both lib and lib64.

like image 80
niko Avatar answered Oct 09 '22 05:10

niko