[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: location of arch-dependent python module



On Mon, Nov 16, 2020 at 2:18 PM Kasper Peeters wrote:

> I am trying to package a program which contains a Python module. This
> module is not written in Python, but in C++/pybind11. It seems to me
> that the '.so' file this produces should go into an arch-dependent
> directory, e.g.
>
>    /usr/lib/x86_64-linux-gnu/python3.6/site-packages/

Most Python packages appear to put .so files in a different location:

$ apt-file search x86_64-linux-gnu | grep python | grep .so | grep
packages | grep ^python3- | head -n1
python3-acora: /usr/lib/python3/dist-packages/acora/_acora.cpython-38-x86_64-linux-gnu.so

Very few packages put them outside of that directory:

$ apt-file search x86_64-linux-gnu | grep python | grep .so | grep
packages | grep -v '/usr/lib/python[.0-9]*/dist-packages/'
distcc-pump: /usr/lib/distcc-pump/lib/python3.8/site-packages/include_server/distcc_pump_c_extensions.cpython-38-x86_64-linux-gnu.so
lirc: /usr/lib/x86_64-linux-gnu/python3.8/site-packages/lirc/_client.so
python3-dolfin-real:
/usr/lib/petscdir/petsc3.13/x86_64-linux-gnu-real/lib/python3/dist-packages/dolfin/cpp.cpython-38-x86_64-linux-gnu.so
...

> However, these are not part of 'site.path' on Debian, and so they will
> not be picked up with an 'import ...'.

I guess you mean sys.path here as site.path doesn't exist:

$ python3
Python 3.8.6 (default, Sep 25 2020, 09:36:53)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> site.path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'site' has no attribute 'path'

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


Reply to: