lib中python是ucs2编译的,所以需要本地系统python也是ucs2才兼容,可以通过import sys
if sys.maxunicode > 65535:
print ‘UCS4 build’
else:
print ‘UCS2 build’
安装pthon的时候指定./configure –enable-unicode=ucs2pyconfig.h 找不到
find /usr/include -name pyconfig.h
/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
解决方案
make clean
export CPLUS_INCLUDE_PATH=/usr/include/python2.7
make all -j8
ps:注意python/include下是否还有子目录python2.7 如果有写成python/include/python2.7
有的版本python2.7没有Pyconfig.h ,将pyconfig.h复制一份/usr/bin/ld: cannot find -lpython2.7
python 的fpic 问题
安装python的时候指定 ./configure –enable-sharedpython 安装目标路径
./configure –prefix=/usr/local/python-2.7Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8’ can not be used when making
pycaffe 安装常见问题
最新推荐文章于 2023-02-21 14:48:13 发布
在安装pycaffe时遇到的问题包括Python的UCS2编译兼容性,pyconfig.h缺失,libpython2.7找不到,以及与OpenCV的链接错误。解决方法包括指定Python配置为UCS2,设置CPLUS_INCLUDE_PATH,清理并重新构建,确保动态库启用,调整环境变量,使用conda管理依赖,并解决numpy和opencv的版本冲突。
摘要由CSDN通过智能技术生成