module 'io' has no attribute 'OpenWrapper'

来源:互联网 发布:淘宝有暗号 编辑:程序博客网 时间:2024/06/05 06:45


D:\Users\Administrator\Miniconda3\envs\python3\python.exe E:/tensor/mx-rcnn-master/demo.py
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: module 'io' has no attribute 'OpenWrapper'


Current thread 0x00004114 (most recent call first):

原因未知,换成python2,就不报错了

用命令行,python3的环境,也不报错

不知道为什么,pycharm+python3的环境,就报错了

我把pycharm重装了,也报错


解决方法:新建一个python3的项目,print(111)正常,那么问题出在此项目中,


继续排查,项目中有个目录rcnn,里面有个包名叫io,里面有__init__.py文件,估计把系统的io给覆盖了,io中没有OpenWrapper这个属性


临时解决办法,把项目中的io包去掉,能运行了。

长期解决方法还没找到

原创粉丝点击