[英]Installing Orange3 in Anaconda: Mismatching g++ and libstdc++
I'm running Fedora 25, which comes with gcc/g++/libstdc++
version 6.3.1. 我正在运行Fedora 25,它带有
gcc/g++/libstdc++
版本6.3.1。 I'm also running Anaconda version 4.3.1, which comes with libstdc++ 6.0.19
. 我也在运行Anaconda版本4.3.1,该版本随附
libstdc++ 6.0.19
。
When I install Orange3 under Anaconda (by saying "pip install orange3"), some files are compiled with Fedoras g++, but linked against Anacondas libstdc++: 当我在Anaconda下安装Orange3时(说“ pip install orange3”),一些文件是用Fedoras g ++编译的,但是链接到Anacondas libstdc ++:
Note the third line of the output: 注意输出的第三行:
$ ldd ~/anaconda3/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so
linux-vdso.so.1 (0x00007ffe9b5a2000)
libpython3.6m.so.1.0 => /home/marhoy/anaconda3/lib/libpython3.6m.so.1.0 (0x00007efc3a6ef000)
libstdc++.so.6 => /home/marhoy/anaconda3/lib/libstdc++.so.6 (0x00007efc3a3d9000)
libm.so.6 => /lib64/libm.so.6 (0x00007efc3a0ad000)
libgcc_s.so.1 => /home/marhoy/anaconda3/lib/libgcc_s.so.1 (0x00007efc39e97000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007efc39c79000)
libc.so.6 => /lib64/libc.so.6 (0x00007efc398b1000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007efc396ad000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007efc394aa000)
librt.so.1 => /lib64/librt.so.1 (0x00007efc392a2000)
/lib64/ld-linux-x86-64.so.2 (0x000055a3c43d1000)
This causes problems, as there are differences between 6.3.1 and 6.0.19. 这会引起问题,因为6.3.1和6.0.19之间存在差异。 So when I try to use the scatter-plot widget, I get:
因此,当我尝试使用散点图小部件时,我得到:
_grid_density.cpython-36m-x86_64-linux-gnu.so: undefined symbol: __cxa_throw_bad_array_new_length
If I LD_PRELOAD Fedoras libstdc++, everything seems to work fine. 如果我LD_PRELOAD Fedoras libstdc ++,一切似乎都可以正常工作。 And if I install Orange3 outside of Anaconda (by using pip3 install --user orange3), it also works.
如果我在Anaconda外部安装Orange3(通过使用pip3 install --user orange3),它也可以工作。
The reason I'm not installing Orange3 from the conda repository is because it is outdated. 我没有从conda存储库安装Orange3的原因是因为它已过时。
So: How can I make the Orange-files link against my Fedora libstdc++ ? 所以: 我如何使Fedora libstdc ++的Orange-files链接?
Why is _grid_density.cpython-36m-x86_64-linux-gnu.so
picking up the libstdc++.so from ~/anaconda3/lib ? 为什么
_grid_density.cpython-36m-x86_64-linux-gnu.so
从〜/ anaconda3 / lib中获取libstdc ++。so? Because of RPATH: 由于RPATH:
(root)# chrpath -l /conda/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so
/conda/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so: RPATH=/conda/lib
I am guessing, you probably had the conda package libgcc
installed and you didn't have the conda package gcc
installed while installing Orange3 using pip. 我猜,您可能已经安装了conda软件包
libgcc
,而在使用pip安装Orange3时没有安装conda软件包gcc
。 Hence the conflict. 因此发生了冲突。
You have the following options: 您有以下选择:
conda remove -y libgcc
conda remove -y libgcc
Remove RPATH from the .so file 从.so文件中删除RPATH
(root)# chrpath -d /conda/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so (root)# chrpath -l /conda/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so /conda/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so: no rpath or runpath tag found.
Convert RPATH
to RUNPATH
: 转换
RPATH
到RUNPATH
:
(root)# chrpath -c /conda/lib/python3.6/site-packages/Orange/widgets/utils/_grid_density.cpython-36m-x86_64-linux-gnu.so
So that you can later override it by doing: 这样您以后可以通过执行以下操作覆盖它:
LD_LIBRARY_PATH=/lib64 /path/to/python/program
Build your own package. 构建自己的包。
I would strongly oppose option 2 or 3. You can do 1 only if there is no dependency on that package from other packages. 我强烈反对选项2或3。只有在不依赖于其他程序包的情况下,您才可以执行1。 The best solution is to do 4, or use conda-forge (as of now, it has v3.4.0).
最好的解决方案是执行4,或使用conda-forge(到目前为止,它具有v3.4.0)。
$ pip uninstall Orange3
$ conda install -c conda-forge orange3
You can take a look at the recipe for orange3 at https://github.com/conda-forge/orange3-feedstock/tree/master/recipe , modify it for the latest version you want (v3.4.1) and upload it to your own channel on anaconda.org too! 您可以在https://github.com/conda-forge/orange3-feedstock/tree/master/recipe上查看orange3的配方,将其修改为所需的最新版本(v3.4.1),然后将其上传到您也可以在anaconda.org上自己的频道!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.