tonysimpson / nanomsg-python

nanomsg wrapper for python with multiple backends (CPython and ctypes) should support 2/3 and Pypy
MIT License
382 stars 85 forks source link

Could not load the default wrapper for your platform: cpy, performance may be affected! #45

Open rogerdehe opened 8 years ago

rogerdehe commented 8 years ago

I install nanomsg with pip install nanomsg, I got this waring:

/home/roger/anaconda/envs/crawler/lib/python2.7/site-packages/nanomsg_wrappers/__init__.py:22: UserWarning: Could not load the default wrapper for your platform: cpy, performance may be affected!
"%s, performance may be affected!") % (default,))

and I have set up

export LD_LIBRARY_PATH=/usr/local/lib

what is wrong?

codypiersall commented 7 years ago

This is an old issue, but when I had this problem it was because I didn't have nanomsg header files on my computer. I just had to install them.

If you run pip install -v nanomsg (that just added the verbose flag), you may get more information about why the extension couldn't be built. The error I was getting was

_nanomsg_cpy/wrapper.c:4:24: fatal error: nanomsg/nn.h: No such file or directory

plus a big warning banner saying the extension could not be built.

So I just had to install the header files. Note that the verbose flag to pip also gives you lots of information you probably don't care about as well.

Alex-CodeLab commented 5 years ago

(python3.5) For me it fails because it can not find the module

ImportError: No module named '_nanomsg_cpy'