Deploying numpy

Hi! I am trying to deploy a project which uses numpy. Here is a minimal example which shows my issue.

This is my requirements.txt :

panda3d==1.10.6
numpy

This is my setup.py :

from direct.dist.commands import bdist_apps
from setuptools import setup


setup(
    name='TryNumpy',
    options={
        'build_apps': {
            'log_filename': '$USER_APPDATA/TryNumpy/trynumpy.log',
            'plugins': ['pandagl'],
            'gui_apps': {'trynumpy': 'main.py'},
            'platforms': ['manylinux1_x86_64'],
        },
        'bdist_apps': {
            'installers': {
                'manylinux1_x86_64': ['xztar']}}})

This is my main.py :

import numpy
from direct.showbase.ShowBase import ShowBase

class Program(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

Program().run()

When I try to build it, I get this:


$ python setup.py bdist_apps
running bdist_apps
running build_apps
Building platforms: manylinux1_x86_64
Gathering wheels for platform: manylinux1_x86_64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt, https://archive.panda3d.org/thirdpa
rty                                                                                                                    
Collecting panda3d==1.10.6 (from -r /home/flavio/build_numpy/requirements.txt (line 1))
  File was already downloaded /home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/panda3d-1.10.6+opt-cp
36-cp36m-manylinux1_x86_64.whl                                                                                         
Collecting numpy (from -r /home/flavio/build_numpy/requirements.txt (line 2))
  File was already downloaded /home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/numpy-1.18.5-cp36-cp3
6m-manylinux1_x86_64.whl                                                                                               
Successfully downloaded panda3d numpy
WARNING: You are using pip version 19.2.3, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Building runtime for platform: manylinux1_x86_64
There are some missing modules: ['ConfigParser', 'Numeric', 'StringIO', '__builtin__', '__svn_version__', '_distutils_fi
ndvs', '_manylinux', '_psutil_windows', '_scproxy', '_winapi', 'apport_python_hook', 'backports.ssl_match_hostname', 'cf
fi', 'com.sun', 'com.sun.jna', 'com.sun.jna.platform', 'commands', 'compat.long', 'copy_reg', 'core.abs', 'core.max', 'c
ore.min', 'core.round', 'cpickle', 'ctypes.macholib.dyld', 'dummy.Process', 'dummy_thread', 'extern.six', 'fcompiler.FCo
mpiler', 'fcompiler.has_f90_header', 'fcompiler.is_f_file', 'future_builtins', 'multiprocessing.AuthenticationError', 'm
ultiprocessing.BufferTooShort', 'multiprocessing.SimpleQueue', 'multiprocessing.TimeoutError', 'multiprocessing.get_cont
ext', 'multiprocessing.get_start_method', 'multiprocessing.set_start_method', 'netbios', 'nose', 'nose.plugins', 'nose.p
lugins.base', 'nose.plugins.builtin', 'nose.plugins.errorclass', 'nose.util', 'numarray', 'numpy.amax', 'numpy.amin', 'n
umpy.array', 'numpy.bool_', 'numpy.compat.asbytes', 'numpy.compat.asstr', 'numpy.compat.asunicode', 'numpy.compat.basest
ring', 'numpy.compat.bytes', 'numpy.compat.contextlib_nullcontext', 'numpy.compat.integer_types', 'numpy.compat.is_pathl
ib_path', 'numpy.compat.isfileobj', 'numpy.compat.long', 'numpy.compat.npy_load_module', 'numpy.compat.open_latin1', 'nu
mpy.compat.os_PathLike', 'numpy.compat.os_fspath', 'numpy.compat.pickle', 'numpy.compat.unicode', 'numpy.core.Inf', 'num
py.core.add', 'numpy.core.all', 'numpy.core.amax', 'numpy.core.amin', 'numpy.core.arange', 'numpy.core.array', 'numpy.co
re.array2string', 'numpy.core.array_repr', 'numpy.core.asanyarray', 'numpy.core.asarray', 'numpy.core.atleast_1d', 'nump
y.core.atleast_2d', 'numpy.core.atleast_3d', 'numpy.core.bool_', 'numpy.core.cdouble', 'numpy.core.complexfloating', 'nu
mpy.core.conjugate', 'numpy.core.count_nonzero', 'numpy.core.csingle', 'numpy.core.divide', 'numpy.core.dot', 'numpy.cor
e.double', 'numpy.core.dtype', 'numpy.core.empty', 'numpy.core.empty_like', 'numpy.core.errstate', 'numpy.core.fastCopyA
ndTranspose', 'numpy.core.finfo', 'numpy.core.float32', 'numpy.core.float_', 'numpy.core.geterrobj', 'numpy.core.hstack'
, 'numpy.core.iinfo', 'numpy.core.inexact', 'numpy.core.inf', 'numpy.core.intc', 'numpy.core.integer', 'numpy.core.intp'
, 'numpy.core.isfinite', 'numpy.core.isinf', 'numpy.core.isnan', 'numpy.core.isnat', 'numpy.core.isscalar', 'numpy.core.
linspace', 'numpy.core.matmul', 'numpy.core.moveaxis', 'numpy.core.multiply', 'numpy.core.ndarray', 'numpy.core.newaxis'
, 'numpy.core.number', 'numpy.core.object_', 'numpy.core.ones', 'numpy.core.product', 'numpy.core.result_type', 'numpy.c
ore.roll', 'numpy.core.sign', 'numpy.core.signbit', 'numpy.core.single', 'numpy.core.sqrt', 'numpy.core.sum', 'numpy.cor
e.swapaxes', 'numpy.core.take', 'numpy.core.transpose', 'numpy.core.ufunc', 'numpy.core.vstack', 'numpy.core.zeros', 'nu
mpy.deprecate', 'numpy.dtype', 'numpy.expand_dims', 'numpy.eye', 'numpy.fft.fft', 'numpy.fft.ifft', 'numpy.frombuffer', 
'numpy.histogramdd', 'numpy.integer', 'numpy.intp', 'numpy.iscomplexobj', 'numpy.lib.i0', 'numpy.lib.imag', 'numpy.lib.i
scomplexobj', 'numpy.lib.real', 'numpy.linalg.eigvals', 'numpy.linalg.inv', 'numpy.linalg.lstsq', 'numpy.linalg.matrix_p
ower', 'numpy.ma.MAError', 'numpy.ma.MaskedArray', 'numpy.ma.filled', 'numpy.ma.getdata', 'numpy.ma.getmaskarray', 'nump
y.ma.make_mask_descr', 'numpy.ma.masked', 'numpy.ma.masked_array', 'numpy.ma.nomask', 'numpy.ndarray', 'numpy.random.ran
d', 'numpy.random.randn', 'numpy.recarray', 'numpy.testing.jiffies', 'numpy.testing.memusage', 'numpy_distutils', 'numpy
_distutils.command.build_flib', 'numpy_distutils.command.cpuinfo', 'numpy_distutils.cpuinfo', 'numpy_distutils.fcompiler
', 'ordereddict', 'org.python.modules.posix.PosixModule', 'pickle5', 'pkg_resources.extern.appdirs', 'pkg_resources.exte
rn.packaging', 'pkg_resources.extern.six', 'pkg_resources.extern.six.moves', 'psutil._psutil_aix', 'psutil._psutil_bsd',
 'psutil._psutil_osx', 'psutil._psutil_sunos', 'psutil._psutil_windows', 'pytest', 'sets', 'setuptools.extern.packaging'
, 'setuptools.extern.packaging.utils', 'setuptools.extern.packaging.version', 'setuptools.extern.six', 'setuptools.exter
n.six.moves', 'setuptools.extern.six.moves.configparser', 'testing.Tester', 'thread', 'urllib2', 'urlparse', 'win32com.s
hell', 'win32con', 'win32pdh', 'win32wnet', 'wincertstore']                                                            
warning: build_apps: could not find dependency libopenblasp-r0-34a18dc3.3.7.so (referenced by numpy.core._multiarray_uma
th.so)                                                                                                                 

Copying game files for platform: manylinux1_x86_64

Building xztar for platform: manylinux1_x86_64

When I launch it, I get:


Traceback (most recent call last):
  File "/home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/numpy-1.18.5-
cp36-cp36m-manylinux1_x86_64.whl/numpy/core/__init__.py", line 24, in            
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 1023, in _handle_fr
omlist                                                                                   
    _call_with_frames_removed(import_, from_name)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 219, in _call_with_
frames_removed                                                                           
    return f(*args, **kwds)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 971, in _find_and_l
oad                                                                                      
    return _find_and_load_unlocked(name, import_)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 955, in _find_and_l
oad_unlocked                                                                             
    module = _load_unlocked(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 665, in _load_unloc
ked                                                                                      
    spec.loader.exec_module(module)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 807, in exec_module
    exec(code, module.__dict__)
  File "/home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/numpy-1.18.5-
cp36-cp36m-manylinux1_x86_64.whl/numpy/core/multiarray.py", line 14, in          
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 1023, in _handle_fr
omlist                                                                                   
    _call_with_frames_removed(import_, from_name)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 219, in _call_with_
frames_removed                                                                           
    return f(*args, **kwds)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 971, in _find_and_l
oad                                                                                      
    return _find_and_load_unlocked(name, import_)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 955, in _find_and_l
oad_unlocked                                                                             
    module = _load_unlocked(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 665, in _load_unloc
ked                                                                                      
    spec.loader.exec_module(module)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 807, in exec_module
    exec(code, module.__dict__)
  File "/home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/numpy-1.18.5-
cp36-cp36m-manylinux1_x86_64.whl/numpy/core/overrides.py", line 7, in            
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 971, in _find_and_l
oad                                                                                      
    return _find_and_load_unlocked(name, import_)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 955, in _find_and_l
oad_unlocked                                                                             
    module = _load_unlocked(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 665, in _load_unloc
ked                                                                                      
    spec.loader.exec_module(module)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 807, in exec_module
    exec(code, module.__dict__)
  File "numpy.core._multiarray_umath", line 1, in 
  File "/home/flavio/venv/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 684, in _load
    return _load_unlocked(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 658, in _load_unloc
ked                                                                                      
    module = module_from_spec(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 571, in module_from
_spec                                                                                    
    module = spec.loader.create_module(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap_external.py", line 922, in cr
eate_module                                                                              
    _imp.create_dynamic, spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 219, in _call_with_
frames_removed                                                                           
    return f(*args, **kwds)
ImportError: libopenblasp-r0-34a18dc3.3.7.so: cannot open shared object file: No such file
 or directory                                                                            

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 12, in 
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 971, in _find_and_l
oad                                                                                      
    return _find_and_load_unlocked(name, import_)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 955, in _find_and_l
oad_unlocked                                                                             
    module = _load_unlocked(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 665, in _load_unloc
ked                                                                                      
    spec.loader.exec_module(module)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 807, in exec_module
    exec(code, module.__dict__)
  File "/home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/numpy-1.18.5-
cp36-cp36m-manylinux1_x86_64.whl/numpy/__init__.py", line 142, in                
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 1023, in _handle_fr
omlist                                                                                   
    _call_with_frames_removed(import_, from_name)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 219, in _call_with_
frames_removed                                                                           
    return f(*args, **kwds)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 971, in _find_and_l
oad                                                                                      
    return _find_and_load_unlocked(name, import_)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 955, in _find_and_l
oad_unlocked                                                                             
    module = _load_unlocked(spec)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 665, in _load_unloc
ked                                                                                      
    spec.loader.exec_module(module)
  File "/home/flavio/venv/lib/python3.6/importlib/_bootstrap.py", line 807, in exec_module
    exec(code, module.__dict__)
  File "/home/flavio/build_numpy/build/__whl_cache__/manylinux1_x86_64_cp36m/numpy-1.18.5-
cp36-cp36m-manylinux1_x86_64.whl/numpy/core/__init__.py", line 50, in            
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.6 from "/home/flavio/build_numpy/build/manylinux1_x86_6
4/trynumpy"                                                                              
  * The NumPy version is: "1.18.5"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libopenblasp-r0-34a18dc3.3.7.so: cannot open shared object file: No su
ch file or directory                                                                     

What is my error? Thank you very much!

It’s a known issue, see https://github.com/panda3d/panda3d/issues/914

The current workaround is to add :

        'package_data_dirs':
        {
         'numpy': [('numpy.libs/*', '', {'PKG_DATA_MAKE_EXECUTABLE'})],
        },

to you setup.py

Thank you very much for your answer! Unfortunately, it doesn’t work. This is my new setup.py :

from direct.dist.commands import bdist_apps
from setuptools import setup


setup(
    name='TryNumpy',
    options={
        'build_apps': {
            'log_filename': '$USER_APPDATA/TryNumpy/trynumpy.log',
            'plugins': ['pandagl'],
            'gui_apps': {'trynumpy': 'main.py'},
            'platforms': ['manylinux1_x86_64'],
            'package_data_dirs': {
                'numpy': [('numpy.libs/*', '', {'PKG_DATA_MAKE_EXECUTABLE'})]}
        },
        'bdist_apps': {
            'installers': {
                'manylinux1_x86_64': ['xztar']}}})

I obtain the same output, exactly. Should this be enough to get it working? Thanks!

It should be enough, I’ve got a CI running that builds and tests my app (which is using numpy) and so far it works like a charm.

However you are using numpy 1.18.5 but my last runs are still using 1.18.4 so maybe numpy moved again their libraries and the workaround is no longer working. I will try and have a look today or tomorrow.

1 Like

I tried with your setup and test app on my PC and I don’t have the problem.

The build output is :

running bdist_apps
running build_apps
Building platforms: manylinux1_x86_64
Gathering wheels for platform: manylinux1_x86_64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt, https://archive.panda3d.org/thirdparty
Collecting panda3d==1.10.6
  File was already downloaded /old/home/test_numpy/build/__whl_cache__/manylinux1_x86_64_cp35m/panda3d-1.10.6+opt-cp35-cp35m-manylinux1_x86_64.whl
Collecting numpy
  File was already downloaded /old/home/test_numpy/build/__whl_cache__/manylinux1_x86_64_cp35m/numpy-1.18.5-cp35-cp35m-manylinux1_x86_64.whl
Successfully downloaded panda3d numpy
WARNING: You are using pip version 19.3.1; however, version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Building runtime for platform: manylinux1_x86_64
There are some missing modules: ['ConfigParser', 'Numeric', 'StringIO', '__builtin__', '__svn_version__', '_psutil_windows', '_scproxy', '_sysconfigdata_dm', '_winapi', 'apport_python_hook', 'backports.ssl_match_hostname', 'com.sun', 'com.sun.jna', 'com.sun.jna.platform', 'commands', 'compat.long', 'copy_reg', 'core.abs', 'core.max', 'core.min', 'core.round', 'cpickle', 'ctypes.macholib.dyld', 'dummy.Process', 'dummy_thread', 'extern.six', 'fcompiler.FCompiler', 'fcompiler.has_f90_header', 'fcompiler.is_f_file', 'future_builtins', 'multiprocessing.AuthenticationError', 'multiprocessing.BufferTooShort', 'multiprocessing.SimpleQueue', 'multiprocessing.TimeoutError', 'multiprocessing.get_context', 'multiprocessing.get_start_method', 'multiprocessing.set_start_method', 'netbios', 'nose', 'nose.plugins', 'nose.plugins.base', 'nose.plugins.builtin', 'nose.plugins.errorclass', 'nose.util', 'numarray', 'numpy.amax', 'numpy.amin', 'numpy.array', 'numpy.bool_', 'numpy.compat.asbytes', 'numpy.compat.asstr', 'numpy.compat.asunicode', 'numpy.compat.basestring', 'numpy.compat.bytes', 'numpy.compat.contextlib_nullcontext', 'numpy.compat.integer_types', 'numpy.compat.is_pathlib_path', 'numpy.compat.isfileobj', 'numpy.compat.long', 'numpy.compat.npy_load_module', 'numpy.compat.open_latin1', 'numpy.compat.os_PathLike', 'numpy.compat.os_fspath', 'numpy.compat.pickle', 'numpy.compat.unicode', 'numpy.core.Inf', 'numpy.core.add', 'numpy.core.all', 'numpy.core.amax', 'numpy.core.amin', 'numpy.core.arange', 'numpy.core.array', 'numpy.core.array2string', 'numpy.core.array_repr', 'numpy.core.asanyarray', 'numpy.core.asarray', 'numpy.core.atleast_1d', 'numpy.core.atleast_2d', 'numpy.core.atleast_3d', 'numpy.core.bool_', 'numpy.core.cdouble', 'numpy.core.complexfloating', 'numpy.core.conjugate', 'numpy.core.count_nonzero', 'numpy.core.csingle', 'numpy.core.divide', 'numpy.core.dot', 'numpy.core.double', 'numpy.core.dtype', 'numpy.core.empty', 'numpy.core.empty_like', 'numpy.core.errstate', 'numpy.core.fastCopyAndTranspose', 'numpy.core.finfo', 'numpy.core.float32', 'numpy.core.float_', 'numpy.core.geterrobj', 'numpy.core.hstack', 'numpy.core.iinfo', 'numpy.core.inexact', 'numpy.core.inf', 'numpy.core.intc', 'numpy.core.integer', 'numpy.core.intp', 'numpy.core.isfinite', 'numpy.core.isinf', 'numpy.core.isnan', 'numpy.core.isnat', 'numpy.core.isscalar', 'numpy.core.linspace', 'numpy.core.matmul', 'numpy.core.moveaxis', 'numpy.core.multiply', 'numpy.core.ndarray', 'numpy.core.newaxis', 'numpy.core.number', 'numpy.core.object_', 'numpy.core.ones', 'numpy.core.product', 'numpy.core.result_type', 'numpy.core.roll', 'numpy.core.sign', 'numpy.core.signbit', 'numpy.core.single', 'numpy.core.sqrt', 'numpy.core.sum', 'numpy.core.swapaxes', 'numpy.core.take', 'numpy.core.transpose', 'numpy.core.ufunc', 'numpy.core.vstack', 'numpy.core.zeros', 'numpy.deprecate', 'numpy.dtype', 'numpy.expand_dims', 'numpy.eye', 'numpy.frombuffer', 'numpy.histogramdd', 'numpy.integer', 'numpy.intp', 'numpy.iscomplexobj', 'numpy.lib.i0', 'numpy.lib.imag', 'numpy.lib.iscomplexobj', 'numpy.lib.real', 'numpy.linalg.eigvals', 'numpy.linalg.inv', 'numpy.linalg.lstsq', 'numpy.linalg.matrix_power', 'numpy.ma.MAError', 'numpy.ma.MaskedArray', 'numpy.ma.filled', 'numpy.ma.getdata', 'numpy.ma.getmaskarray', 'numpy.ma.make_mask_descr', 'numpy.ma.masked', 'numpy.ma.masked_array', 'numpy.ma.nomask', 'numpy.ndarray', 'numpy.recarray', 'numpy.testing.jiffies', 'numpy.testing.memusage', 'numpy_distutils', 'numpy_distutils.command.build_flib', 'numpy_distutils.command.cpuinfo', 'numpy_distutils.cpuinfo', 'numpy_distutils.fcompiler', 'ordereddict', 'org.python.modules.posix.PosixModule', 'pickle5', 'pkg_resources.extern.appdirs', 'pkg_resources.extern.packaging', 'pkg_resources.extern.six', 'pkg_resources.extern.six.moves', 'psutil._psutil_bsd', 'psutil._psutil_osx', 'psutil._psutil_sunos', 'psutil._psutil_windows', 'pytest', 'scipy', 'setuptools.extern.ordered_set', 'setuptools.extern.packaging', 'setuptools.extern.packaging.specifiers', 'setuptools.extern.packaging.tags', 'setuptools.extern.packaging.utils', 'setuptools.extern.packaging.version', 'setuptools.extern.six', 'setuptools.extern.six.moves', 'setuptools.extern.six.moves.configparser', 'testing.Tester', 'thread', 'urllib2', 'urlparse', 'win32com.shell', 'win32con', 'win32pdh', 'win32wnet', 'wincertstore']
warning: build_apps: could not find dependency libopenblasp-r0-34a18dc3.3.7.so (referenced by numpy.linalg.lapack_lite.so)

Copying data files for module: numpy
Copying game files for platform: manylinux1_x86_64

Building xztar for platform: manylinux1_x86_64

It complains that the library libopenblasp-r0-34a18dc3.3.7.so is not found, but the extra package rule copies it into the build directory :

array.cpython-35m-x86_64-linux-gnu.so         libp3dtool.so.1.10                    numpy.random._sfc64.so
binascii.cpython-35m-x86_64-linux-gnu.so      libp3interrogatedb.so.1.10            _opcode.so
_bisect.cpython-35m-x86_64-linux-gnu.so       libpandaexpress.so.1.10               panda3d.core.so
_bz2.so                                       libpandagl.so                         panda3d.direct.so
_codecs_cn.so                                 libpanda.so.1.10                      _pickle.cpython-35m-x86_64-linux-gnu.so
_codecs_hk.so                                 _lzma.so                              _posixsubprocess.cpython-35m-x86_64-linux-gnu.so
_codecs_iso2022.so                            math.cpython-35m-x86_64-linux-gnu.so  psutil._psutil_linux.so
_codecs_jp.so                                 _md5.cpython-35m-x86_64-linux-gnu.so  psutil._psutil_posix.so
_codecs_kr.so                                 mmap.so                               pyexpat.cpython-35m-x86_64-linux-gnu.so
_codecs_tw.so                                 _multibytecodec.so                    _random.cpython-35m-x86_64-linux-gnu.so
_ctypes.so                                    _multiprocessing.so                   readline.so
_curses.so                                    numpy.core._multiarray_tests.so       select.cpython-35m-x86_64-linux-gnu.so
_datetime.cpython-35m-x86_64-linux-gnu.so     numpy.core._multiarray_umath.so       _sha1.cpython-35m-x86_64-linux-gnu.so
_decimal.so                                   numpy.fft._pocketfft_internal.so      _sha256.cpython-35m-x86_64-linux-gnu.so
_elementtree.cpython-35m-x86_64-linux-gnu.so  numpy.linalg.lapack_lite.so           _sha512.cpython-35m-x86_64-linux-gnu.so
grp.cpython-35m-x86_64-linux-gnu.so           numpy.linalg._umath_linalg.so         _socket.cpython-35m-x86_64-linux-gnu.so
_hashlib.so                                   numpy.random._bit_generator.so        _ssl.so
_heapq.cpython-35m-x86_64-linux-gnu.so        numpy.random._bounded_integers.so     _struct.cpython-35m-x86_64-linux-gnu.so
libCgGL.so                                    numpy.random._common.so               termios.so
libCg.so                                      numpy.random._generator.so            trynumpy
libgfortran-ed201abd.so.3.0.0                 numpy.random._mt19937.so              unicodedata.cpython-35m-x86_64-linux-gnu.so
libopenblasp-r0-34a18dc3.3.7.so               numpy.random.mtrand.so                zlib.cpython-35m-x86_64-linux-gnu.so
libp3direct.so.1.10                           numpy.random._pcg64.so
libp3dtoolconfig.so.1.10                      numpy.random._philox.so
</pre.

And the generated package contains the library : 

TryNumpy/
TryNumpy/libp3dtool.so.1.10
TryNumpy/math.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_socket.cpython-35m-x86_64-linux-gnu.so
TryNumpy/select.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_codecs_cn.so
TryNumpy/_codecs_iso2022.so
TryNumpy/libCg.so
TryNumpy/_random.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_opcode.so
TryNumpy/unicodedata.cpython-35m-x86_64-linux-gnu.so
TryNumpy/numpy.random._mt19937.so
TryNumpy/numpy.random._pcg64.so
TryNumpy/_codecs_kr.so
TryNumpy/_hashlib.so
TryNumpy/_multibytecodec.so
TryNumpy/libpandaexpress.so.1.10
TryNumpy/psutil._psutil_linux.so
TryNumpy/_md5.cpython-35m-x86_64-linux-gnu.so
TryNumpy/libCgGL.so
TryNumpy/libp3interrogatedb.so.1.10
TryNumpy/numpy.random._generator.so
TryNumpy/_ssl.so
TryNumpy/numpy.core._multiarray_tests.so
TryNumpy/_multiprocessing.so
TryNumpy/_bisect.cpython-35m-x86_64-linux-gnu.so
TryNumpy/numpy.random._sfc64.so
TryNumpy/_sha512.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_lzma.so
TryNumpy/panda3d.direct.so
TryNumpy/numpy.random._bounded_integers.so
TryNumpy/numpy.random._bit_generator.so
TryNumpy/_heapq.cpython-35m-x86_64-linux-gnu.so
TryNumpy/termios.so
TryNumpy/libp3direct.so.1.10
TryNumpy/_struct.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_datetime.cpython-35m-x86_64-linux-gnu.so
TryNumpy/trynumpy
TryNumpy/_decimal.so
TryNumpy/grp.cpython-35m-x86_64-linux-gnu.so
TryNumpy/libpandagl.so
TryNumpy/_curses.so
TryNumpy/mmap.so
TryNumpy/libgfortran-ed201abd.so.3.0.0
TryNumpy/_elementtree.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_codecs_jp.so
TryNumpy/numpy.linalg.lapack_lite.so
TryNumpy/zlib.cpython-35m-x86_64-linux-gnu.so
TryNumpy/numpy.random.mtrand.so
TryNumpy/libpanda.so.1.10
TryNumpy/_codecs_hk.so
TryNumpy/psutil._psutil_posix.so
TryNumpy/numpy.random._philox.so
TryNumpy/array.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_sha256.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_bz2.so
TryNumpy/libp3dtoolconfig.so.1.10
TryNumpy/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
TryNumpy/numpy.core._multiarray_umath.so
TryNumpy/binascii.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_sha1.cpython-35m-x86_64-linux-gnu.so
TryNumpy/numpy.fft._pocketfft_internal.so
TryNumpy/numpy.random._common.so
TryNumpy/pyexpat.cpython-35m-x86_64-linux-gnu.so
TryNumpy/libopenblasp-r0-34a18dc3.3.7.so
TryNumpy/panda3d.core.so
TryNumpy/_ctypes.so
TryNumpy/readline.so
TryNumpy/numpy.linalg._umath_linalg.so
TryNumpy/_pickle.cpython-35m-x86_64-linux-gnu.so
TryNumpy/_codecs_tw.so

And the test app runs fine.

Could you try again and use the -v option to see if the file is correctly copied ?

python3 setup.py -v bdist_apps

Also, could you do a ls in the build directory after running the command and list the content of the generated package ?

Thank you eldee, it works! I was misled by the error message. Now I understand how package_data_dirs works. Thank you so much!