我正在尝试从源代码中安装MXNet库的python绑定:
https://mxnet.incubator.apache.org/install/ubuntu_setup.html#install-mxnet-for-python
使用g ++成功构建主二进制文件后,以开发/可编辑模式安装其python绑定没有问题:
pip install -e .
但是,当我尝试部署完整的程序包时(而不是仅创建符号链接)
pip install .
我遇到以下错误:
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/
pip似乎没有将../../lib/libmxnet.so
复制到tmp中,因为它位于python软件包目录之外。在安装时,我该如何指示pip复制该文件(如果可能,还要复制父目录下的所有文件)?
答案 0 :(得分:0)
您的libmxnet.so在哪里?它应该在主目录中,因此在您的情况下为:/ git-fork / mxnet。然后,setup.py脚本应立即可用。您还可以通过调整以下行LIB_PATH = libinfo'find_lib_path'
在setup.py中手动设置路径。