tonysimpson / nanomsg-python

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

Install is a little finicky on OSX #24

Open drewcrawford opened 10 years ago

drewcrawford commented 10 years ago

I've noticed that installs are particularly finicky on OSX.

Suppose this configuration:

  1. nanomsg 0.4 installed via homebrew (to /usr/local/lib/libnanomsg.* and /usr/include/nanomsg)
  2. Python 3.4 from python.org

There's not a good way to install nanomsg-python from pip. For example you might naively try

pip3.4 install -e git+https://github.com/tonysimpson/nanomsg-python#egg=nanomsg

But it turns out that neither /usr/local/lib is in lib search path nor is /usr/include in include search path by default. Arguably this is somebody else's bug, but it's inconvenient.

The workaround is to download the repo yourself and specify manually with build_ext:

python3 setup.py build_ext --include-dirs /usr/local/include --library-dirs=/usr/local/lib/
python3 setup.py install

But for requirements.txt or other pip install, this is very unsatisfactory.

Finally, using python3 setup.py develop in lieu of python3 setup.py install is inexplicably broken; it installs without error but it fails to import.

I'm not totally sure what is afoot here, but I've seen this behavior on 2 systems now and so it may be worth investigating