Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pycharm &引用;Can';t获取属性";用泡菜装_Pycharm_Attributeerror - Fatal编程技术网

Pycharm &引用;Can';t获取属性";用泡菜装

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: ---

如果我试图打开并读取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:
---->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'>