Pycharm &引用;Can';t获取属性";用泡菜装
如果我试图打开并读取shell中的pickle文件,则会出现以下错误:Pycharm &引用;Can';t获取属性";用泡菜装,pycharm,attributeerror,Pycharm,Attributeerror,如果我试图打开并读取shell中的pickle文件,则会出现以下错误: with open("labeled_data_test.pkl","rb") as fp: ----> 2 data = pickle.load(fp) 3 AttributeError: Can't get attribute 'LabeledData' on <module '__main__' 将open(“labeled_data_test.pkl”、“rb”)作为fp: ---
with open("labeled_data_test.pkl","rb") as fp:
----> 2 data = pickle.load(fp)
3
AttributeError: Can't get attribute 'LabeledData' on <module '__main__'
将open(“labeled_data_test.pkl”、“rb”)作为fp:
---->2数据=pickle.load(fp)
3.
AttributeError:无法在上获取属性'LabeledData',从终端执行时,该属性是否有效?尝试在用于启动脚本的PyCharm运行配置中禁用“将内容根添加到PYTHONPATH”选项。否,来自终端的相同问题。我现在将完整的类复制到文件中,而不是“简单地”导入它。这很有帮助。奇怪的但是成功了。
correct = pickle.load(fp)
AttributeError: Can't get attribute 'LabeledData' on <module '__main__' from 'C:\\Program Files\\JetBrains\\PyCharm Community Edition 2018.3.4\\helpers\\pycharm\\_jb_unittest_runner.py'>