其他分享
首页 > 其他分享> > pycharm文件名禁忌

pycharm文件名禁忌

作者:互联网

自己创建的文件名不能叫abc.py,不然会报如下错误
在这里插入图片描述
Fatal Python error: init_sys_streams: can’t initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File “D:\Anaconda\lib\io.py”, line 72, in
AttributeError: module ‘abc’ has no attribute ‘ABCMeta’

参考:
If you name your file abc.py you’re shadowing the standard library’s abc (abstract base class). When you do that, everything that depends on the built-in abc will get yours instead. Unless you’ve essentially rewritten the standard library’s code, things will break.
– Ernst Jun 28, 2018 at 9:57

标签:abc,文件名,Python,py,禁忌,library,standard,sys,pycharm
来源: https://blog.csdn.net/Jinyindao243052/article/details/123130949