nanomsg / nnpy

cffi-based Python bindings for nanomsg
MIT License
117 stars 39 forks source link

Install error #53

Open tannn opened 6 years ago

tannn commented 6 years ago

When trying to install nnpy via pip3 or pip, we ran into this error:

    Installed /private/var/folders/3b/h9c7nf7x6_xgvy9yqb7xj8rh0000gn/T/pip-build-r14uxj7z/nnpy/.eggs/pycparser-2.18-py3.6.egg
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/3b/h9c7nf7x6_xgvy9yqb7xj8rh0000gn/T/pip-build-r14uxj7z/nnpy/setup.py", line 28, in <module>
        install_requires=['cffi'],
      File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 372, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 528, in finalize_options
        ep.load()(self, ep.name, value)
      File "/private/var/folders/3b/h9c7nf7x6_xgvy9yqb7xj8rh0000gn/T/pip-build-r14uxj7z/nnpy/.eggs/cffi-1.11.5-py3.6-macosx-10.13-x86_64.egg/cffi/setuptools_ext.py", line 204, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/private/var/folders/3b/h9c7nf7x6_xgvy9yqb7xj8rh0000gn/T/pip-build-r14uxj7z/nnpy/.eggs/cffi-1.11.5-py3.6-macosx-10.13-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/private/var/folders/3b/h9c7nf7x6_xgvy9yqb7xj8rh0000gn/T/pip-build-r14uxj7z/nnpy/.eggs/cffi-1.11.5-py3.6-macosx-10.13-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 120, in <module>
        ffi = create_module()
      File "generate.py", line 103, in create_module
        hfiles = header_files(set_source_args['include_dirs'])
      File "generate.py", line 28, in header_files
        return {fn: os.path.join(dir, fn) for fn in os.listdir(dir)
    FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/include/nanomsg'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3b/h9c7nf7x6_xgvy9yqb7xj8rh0000gn/T/pip-build-r14uxj7z/nnpy/

We saw issue #52, which has a similar error, except we have tried to install on macOS, Ubuntu, and Windows 10. Each time we received this same error.

Any help would be appreciated.

djc commented 6 years ago

Do you have nanomsg installed, including the headers? This code is effectively erroring out because it can't find the include directory for nanomsg. In this case, it looks like you're installing on macOS? By default the code looks for /usr/include/nanomsg/ and /usr/local/include/nanomsg, so if your nanomsg headers live somewhere else you have to customize something.

sebitas0623 commented 5 years ago

the problem has been resolved? how?

sebitas0623 commented 5 years ago

I have solved the problem installing manually the nanomsg library from https://github.com/nanomsg/nanomsg. First I clone the repository into the /usr/local/include and then I ran the command specified in the github. After that I could install the nnpy library.

Marv-plc commented 4 years ago

I run into the same problem on my raspberry pi zero setup as a mozilla-iot gateway. I tried to install nanomsg via the following comands, which were suggested somewhere on the internet did not work: sudo apt install libffi-dev libnanomsg4 libnanomsg-dev aso (Error message: Unable to locate package libnanomsg4) The steps describeded by sebitas0623 worked for me. Thanks a lot.