python - 我无法读取和打印我的 Json 文件。未能加载原生 TensorFlow 运行时
问题描述
我正在尝试创建一个聊天机器人。我创建了一个 Json 文件,其中包含一些可能的问题和答案。但我正在尝试运行以下 python 代码来加载和打印名为“intents.json”的 Json 文件中的问题和答案。
mport nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
import numpy
import tflearn
import tensorflow
import random
import json
#read json file
with open("intents.json") as file:
data = json.load(file)
print(data)
但我遇到以下错误......请我需要你们的帮助:(
PS C:\Users\PRINCE\Documents\SONISOFT\Python Tutors\Python Chat Bot Tutorial\Chat-bot> python main.py Traceback (most recent call last):
File "C:\Users\PRINCE\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 6, in <module>
import tflearn
File "C:\Users\PRINCE\anaconda3\lib\site-packages\tflearn\__init__.py", line 4, in <module>
import tensorflow.compat.v1 as tf
File "C:\Users\PRINCE\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\PRINCE\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Users\PRINCE\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\PRINCE\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
寻求帮助时出现此错误消息。
解决方案
推荐阅读
- python - 保存到用户设备和从用户设备中提取 | 蟒蛇电报机器人
- go - Golang 修复 jpeg 错误的 EOF 格式
- sql - SQL JSON_VALUE 选择父值
- linux - 是否可以在 WSL(Windows 下的 Linux)下运行无头 Selenium?
- javascript - 半折叠侧边栏
- python - 如何使用 ACA-Py 框架将非机密数据存储在 aries 代理存储中?
- scala - 从必须实现类型类的方法返回值
- javascript - Laravel 无法读取 formData
- elasticsearch - elasticsearch 按链顺序搜索查询
- powershell - 散列文字中的键后缺少“=”运算符不完整?