C:\Users\26921\PycharmProjects\pythonProject\jsonxinhuanjing\Scripts\python.exe C:\Users\26921\PycharmProjects\pythonProject\second.py 5%|▍ | 484/10000 [13:34<4:26:59, 1.68s/it] Traceback (most recent call last): File "C:\Users\26921\PycharmProjects\pythonProject\second.py", line 34, in <module> if sentiment_classify(txt) > 0.5: File "C:\Users\26921\PycharmProjects\pythonProject\second.py", line 16, in sentiment_classify results = my_nlp.sentimentClassify(txt) File "C:\Users\26921\PycharmProjects\pythonProject\jsonxinhuanjing\lib\site-packages\aip\nlp.py", line 220, in sentimentClassify return self._request(self.__sentimentClassifyUrl, data) File "C:\Users\26921\PycharmProjects\pythonProject\jsonxinhuanjing\lib\site-packages\aip\base.py", line 104, in _request obj = self._proccessResult(response.content) File "C:\Users\26921\PycharmProjects\pythonProject\jsonxinhuanjing\lib\site-packages\aip\nlp.py", line 86, in _proccessResult return json.loads(str(content, 'gbk')) or {} File "C:\Users\26921\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\26921\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\26921\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
时间: 2023-07-17 15:53:21 浏览: 159
PyCharm-错误-找不到指定文件python.exe的解决方法
5星 · 资源好评率100%
这段错误信息是Python解释器在运行代码时遇到了一个JSON解码错误。具体来说,它在尝试从一个字符串中解码JSON数据时发生了错误,因为这个字符串并不是一个有效的JSON格式数据。根据错误信息,这个字符串在第1行第1列(即开头)就出现了错误,因此很可能是这个字符串的格式有问题,或者是因为网络传输等原因导致数据不完整或损坏。你可以检查一下代码中使用到的JSON数据的来源,或者尝试重新获取这个数据,看看能否解决这个问题。
阅读全文