1

I'm trying to pip install the python binding of MXNet library from source code:

https://mxnet.incubator.apache.org/install/ubuntu_setup.html#install-mxnet-for-python

After the main binary is built successfully using g++, there is no problem in installing its python binding in dev/editable mode:

pip install -e .

however when I try to deploy the full package (instead of just creating a symbolic link)

pip install .

I encounter the following error:

Processing ~/git-fork/mxnet/python
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-k3hfc693/setup.py", line 47, in <module>
        LIB_PATH = libinfo['find_lib_path']()
      File "/tmp/pip-req-build-k3hfc693/mxnet/libinfo.py", line 74, in find_lib_path
        'List of candidates:\n' + str('\n'.join(dll_path)))
    RuntimeError: Cannot find the MXNet library.
    List of candidates:
    /tmp/pip-req-build-k3hfc693/mxnet/libmxnet.so
    /tmp/pip-req-build-k3hfc693/mxnet/../../lib/libmxnet.so
    /tmp/pip-req-build-k3hfc693/mxnet/../../build/libmxnet.so
    ../../../libmxnet.so

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-k3hfc693/

It appears that pip didn't copy ../../lib/libmxnet.so into tmp since it is outside the python package directory. What should I do to instruct pip to copy that file (and if possible, everything under parent directory) when installing?

tribbloid
  • 4,026
  • 14
  • 64
  • 103

1 Answers1

1

Where is your libmxnet.so located? It should be in the main-directory, so in your case: /git-fork/mxnet. Then the setup.py script should work out of the box. You could also manually set the path in setup.py, by adjusting the following line LIB_PATH = libinfo'find_lib_path'

NRauschmayr
  • 131
  • 1