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.
/usr/lib64 is for 64-bit libraries. /usr/lib is for 32-bit compatibility libraries.
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 .
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With