使用pycocotools时出现"undefined symbol: _Py_ZeroStruct"
来源:互联网 发布:折800淘宝 编辑:程序博客网 时间:2024/06/06 13:20
问题描述:
运行
from pycocotools.coco import COCO
报错:
ImportError: /home/elijha/PycharmProjects/LinkinNet/cocoapi-master/PythonAPI/pycocotools/_mask.so: undefined symbol: _Py_ZeroStruct
出错原因
stackoverflow的回答:
This error message is typical when there’s a version mismatch in Python modules. It could something like cython_bbox.so was compiled and linked against Python 2.7 and CNTK was compiled against Python 3.5. It’s hard to say exactly what the reason is but you can try to do make inside a python environment that matches your CNTK version and see if that works.
检查后发现,我把Cython安装在了python2.7的环境内,而且make也是在此环境下进行的。而import的环境是python3.5,因此出错。
解决方法
- 在python2.7下卸载Cython。(这一步其实可以不做,但是因为我从来不用这个环境,就也卸载了。)
- 进入python3.5,执行
pip install Cython
- 重进进入pycocotools文件夹,执行make。(即用python3重新运行pycocotools下的setup.py进行安装。)
- 重新运行
from pycocotools.coco import COCO
,正确。
阅读全文
1 0
- 使用pycocotools时出现"undefined symbol: _Py_ZeroStruct"
- 动态链接时出现undefined symbol错误
- Java jni 加载 so 时,出现 undefined symbol 错误
- 启动apache 出现undefined symbol: apr_ldap_ssl_init
- intel caffe出现undefined symbol: mkl_sparse_d_csr__g_n_syrk_notr_row_struct_i8
- 使用KEIL模板程序时遇到函数undefined symbol函数
- Undefined symbol
- undefined symbol
- mysql动态加载存储引擎时出现errno: 2 undefined symbol: thd_alloc_service
- linux动态库so调用外部so,运行时出现undefined symbol
- 关于解决工程编译出现Undefined symbol __use_two_region_memory 和Undefined symbol __initial_sp的问题
- MTK编译出现Undefined symbol Image$$ZI$$Limit的问题解决
- QT环境下出现undefined refence to symbol...
- MDK编译出现*.axf: Error: L6218E: Undefined symbol 问题解决方法
- linux编译出现undefined reference to symbol 'pthread_create错误解决方案
- JsonCpp 生成的Lib使用时出现unresolved external symbol
- linux下安装svn集成到APACHE上时,启动apache出现:undefined symbol: db_create的错误处理
- ATS 6.2.1打release版本rpm包时插件中出现undefined symbol的问题追踪
- 文件处理命令rmdir
- SQL存储过程跨服务器访问
- android studio Execution failed for clean build失败 open editor
- 基于四元组的图像hash方法
- 3.2 各进制的表示与转换
- 使用pycocotools时出现"undefined symbol: _Py_ZeroStruct"
- onselectstart="return false" : 禁止选取
- 关于JDBC连接数据库
- Vue +Node +Mysql 从简至全(一)
- Android 带动画的底部弹出视图
- struts2拦截器与过滤器的理解
- 初次使用PyCharm,下载安装及汉化
- java开发-JVM监控调优
- Delphi读写ini文件示例