在jupyter 中能运行却在pycharm中无用的读取文档代码

def readfile(path):
    with codecs.open(path,'r',encoding="utf8") as f:
        lines=f.readlines()
    return lines
path=r'C:\Users\Apple\Desktop\1.txt'
readfile(path)



```import codecs
无法读取文档内的内容,这段代码在jupyter中可以运行,在pycharm中就不行,为什么呢?