找不到cannot find -lpython3.5m caffe anaconda python3 ubuntu16.04

在Ubuntu16.04上使用Anaconda3和Caffe时遇到编译错误,LD无法找到-lpython3.5m。错误源于在配置文件中误启用python3的配置。解决方法是将config中的python3.5m改为3.5,并注释掉与之相关的配置,以避免冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: 找不到 -lpython3.5m
collect2: error: ld returned 1 exit status
Makefile:572: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1

 这里提供另一种解决方法,如果你想用pyhton3,而且是anoconda3那么肯定不能用caffe包中的example.config。

你可能仔细看了config然后删除了pyhton3之前的注释,并且把python2注释了,而且还添加了anaconda的配置,然后你运行,就会出现本错误,你可以更改下把config中的3.5m改成3.5你会发现错误也跟着便,没错,就是因为你放出了python3的配置参数,导致了这个错误。所以你应该把python3注释回去。我的config如下:

## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
 CPU_ONLY := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
#    You should not set this flag if you will be reading LMDBs with any
#    possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
#
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值