ubuntu 下 python 调用 c++ 错误问题解决

ImportError:
/home/whut/anaconda2/bin/…/lib/libgomp.so.1: version GOMP_4.0' not found libstdc++.so.6: versionGLIBCXX_3.4.21’ not found

首先查看一下是否真的不存在
strings /home/whut/anaconda2/bin/…/lib/libgomp.so.1 | grep GOMP

GOMP_barrier
GOMP_critical_start
GOMP_critical_end
GOMP_critical_name_start
GOMP_critical_name_end
GOMP_atomic_start
GOMP_atomic_end
GOMP_loop_static_start
GOMP_loop_dynamic_start
GOMP_loop_guided_start
GOMP_loop_runtime_start
GOMP_loop_ordered_static_start
GOMP_loop_ordered_dynamic_start
GOMP_loop_ordered_guided_start
GOMP_loop_ordered_runtime_start
GOMP_loop_static_next
GOMP_loop_dynamic_next
GOMP_loop_guided_next
GOMP_loop_runtime_next
GOMP_loop_ordered_static_next
GOMP_loop_ordered_dynamic_next
GOMP_loop_ordered_guided_next
GOMP_loop_ordered_runtime_next
GOMP_parallel_loop_static_start
GOMP_parallel_loop_dynamic_start
GOMP_parallel_loop_guided_start
GOMP_parallel_loop_runtime_start
GOMP_loop_end
GOMP_loop_end_nowait
GOMP_loop_ull_static_start
GOMP_loop_ull_dynamic_start
GOMP_loop_ull_guided_start
GOMP_loop_ull_runtime_start
GOMP_loop_ull_ordered_static_start
GOMP_loop_ull_ordered_dynamic_start
GOMP_loop_ull_ordered_guided_start
GOMP_loop_ull_ordered_runtime_start
GOMP_loop_ull_static_next
GOMP_loop_ull_dynamic_next
GOMP_loop_ull_guided_next
GOMP_loop_ull_runtime_next
GOMP_loop_ull_ordered_static_next
GOMP_loop_ull_ordered_dynamic_next
GOMP_loop_ull_ordered_guided_next
GOMP_loop_ull_ordered_runtime_next
GOMP_ordered_start
GOMP_ordered_end
GOMP_parallel_start
GOMP_parallel_end
GOMP_sections_start
GOMP_sections_next
GOMP_parallel_sections_start
GOMP_sections_end
GOMP_sections_end_nowait
GOMP_single_start
GOMP_single_copy_start
GOMP_single_copy_end
GOMP_task
GOMP_taskwait
GOMP_taskyield
GOMP_1.0
GOMP_2.0
GOMP_3.0
GOMP_CPU_AFFINITY
GOMP_SPINCOUNT
GOMP_STACKSIZE
not enough memory to store GOMP_CPU_AFFINITY list

在全系统搜索libgomp.so,找到由GOMP_4.0的,替换之。

cp /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0 /home/whut/anaconda2/lib
rm -f libgomp.so.1
ln -s libgomp.so.1.0.0 libgomp.so.1

你可能感兴趣的:(杂项)