8000 OSError: cannot load library libnanomsg.so.5.0.0 · Issue #40 · nanomsg/nnpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.
This repository was archived by the owner on Sep 27, 2021. It is now read-only.
OSError: cannot load library libnanomsg.so.5.0.0 #40
Open
@chekunkov

Description

@chekunkov

nnpy install fails with the following traceback

$ sudo pip install nnpy
Downloading/unpacking nnpy
  Downloading nnpy-1.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/nnpy/setup.py) egg_info for package nnpy
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/nnpy/setup.py", line 28, in <module>
        install_requires=['cffi'],
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 318, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 376, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 187, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 119, in <module>
        ffi = create_module()
      File "generate.py", line 115, in create_module
        f.write(symbols(ffi, host_library))
      File "generate.py", line 56, in symbols
        nanomsg = ffi.dlopen(host_library)
      File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 139, in dlopen
        lib, function_cache = _make_ffi_library(self, name, flags)
      File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 769, in _make_ffi_library
        backendlib = _load_backend_lib(backend, libname, flags)
      File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 764, in _load_backend_lib
        return backend.load_library(path, flags)
    OSError: cannot load library libnanomsg.so.5.0.0: libnanomsg.so.5.0.0: cannot open shared object file: No such file or directory

nanomsg is installed in /usr/local/lib/x86_64-linux-gnu/:

$ ls -la /usr/local/lib/x86_64-linux-gnu/
total 400
drwxr-xr-x 3 root root   4096 Nov  7 20:29 .
drwxr-xr-x 6 root root   4096 Nov  4 13:53 ..
lrwxrwxrwx 1 root root     19 Nov  4 13:53 libnanomsg.so -> libnanomsg.so.5.0.0
-rw-r--r-- 1 root root 395509 Nov  7 20:28 libnanomsg.so.1.0.0
lrwxrwxrwx 1 root root     19 Nov  4 13:53 libnanomsg.so.5.0.0 -> libnanomsg.so.1.0.0
drwxr-xr-x 2 root root   4096 Nov  7 20:29 pkgconfig

LD_LIBRARY_PATH points to that location (I also have https://github.com/tonysimpson/nanomsg-python installed and previously it failed to install without this env var):

export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu/

Code fails on the line https://github.com/nanomsg/nnpy/blob/1.3/generate.py#L56, I tried to dig a bit deeper, it seems like shared library is found by ctypes.util.find_library but fails to load.

$ sudo python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes.util
>>> ctypes.util.find_library('nanomsg')
'libnanomsg.so.5.0.0'
$ sudo pip freeze | grep cffi 
cffi==1.9.1

I also tried with cffi==1.8.3 - same issue.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:    14.04
Codename:   trusty

Any idea how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0