我正在尝试使用Linux安装 adns-python ,并且必须重新编译 adns ,所以我似乎无法使用像往常一样easy_install <tarball>
I am trying to install adns-python using linux and had to recompile adns with some special options, so I can't seem to use easy_install <tarball> as I normally would
(py26_default)[mpenning@localhost src]$ easy_install adns-python-1.2.1.tar.gz Processing adns-python-1.2.1.tar.gz Running adns-python-1.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-9cVl4i/adns-python-1.2.1/egg-dist-tmp-vvO8Ms adnsmodule.c:10:18: error: adns.h: No such file or directory adnsmodule.c:31: error: expected specifier-qualifier-list before âadns_stateâadns.h安装在/opt/adns/include/adns.h下;如何使用adns的本地安装进行easy_install安装?
adns.h is installed under /opt/adns/include/adns.h; how can I make easy_install install with a local installation of adns?
编辑
经过下面的尝试,即使我导出了LD_LIBRARY_PATH ...,我仍然发现ld错误.
After the attempt below, I still find an ld error, even though I exported LD_LIBRARY_PATH...
(py26_default)[mpenning@localhost src]$ ls /opt/adns/lib/ libadns.a libadns.so libadns.so.1 libadns.so.1.2 (py26_default)[mpenning@localhost src]$ export LD_LIBRARY_PATH=/opt/adns/lib (py26_default)[mpenning@localhost src]$ C_INCLUDE_PATH=/opt/adns/include easy_install ./adns-python-1.2.1.tar.gz Processing adns-python-1.2.1.tar.gz Running adns-python-1.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-x68T9f/adns-python-1.2.1/egg-dist-tmp-MpCzMP /usr/bin/ld: cannot find -ladns collect2: ld returned 1 exit status error: Setup script exited with error: command 'gcc' failed with exit status 1 (py26_default)[mpenning@localhost src]$推荐答案
LD_LIBRARY_PATH用于在运行时(运行可执行文件时)而不是在链接过程中查找共享库.
LD_LIBRARY_PATH is used to find a shared library at runtime (when an executable is run), not during linking.
要构建扩展,请打开压缩包并运行:
To build the extension, unpack the tarball and run:
python setup.py build_ext -I/opt/adns/include -L/opt/adns/lib -R/opt/adns/lib要安装:
python setup.py install您可以在setup.cfg中指定build_ext选项:
You could specify build_ext options in setup.cfg:
[build_ext] include_dirs=/opt/adns/include library_dirs=/opt/adns/lib rpath=/opt/adns/lib在这种情况下,您可以直接运行easy_install.
in this case you could run easy_install directly.
更多推荐
Python的easy
发布评论