【发布时间】:2020-08-24 20:21:28
【问题描述】:
这就是我目前在 PyCharm 项目中运行的内容
Windows 10
PyCharm 2020.1.1 (Community Edition)
Python 3.7.7
TensorFlow 2.2.0
这是我在导入方面的代码:
import math
import pandas_datareader as web
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense, LSTM
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
这是错误......
H:\Python\AI\venv\lib\site-packages\pandas_datareader\compat\__init__.py:7: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead. from pandas.util.testing import assert_frame_equal Using TensorFlow backend. Traceback (most recent call last): File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\Chan\AppData\Local\Programs\Python\Python37\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\Chan\AppData\Local\Programs\Python\Python37\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "H:/Python/AI/LSMT.py", line 7, in <module> from keras.models import Sequential File "H:\Python\AI\venv\lib\site-packages\keras\__init__.py", line 3, in <module> from . import utils File "H:\Python\AI\venv\lib\site-packages\keras\utils\__init__.py", line 6, in <module> from . import conv_utils File "H:\Python\AI\venv\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module> from .. import backend as K File "H:\Python\AI\venv\lib\site-packages\keras\backend\__init__.py", line 1, in <module> from .load_backend import epsilon File "H:\Python\AI\venv\lib\site-packages\keras\backend\load_backend.py", line 90, in <module> from .tensorflow_backend import * File "H:\Python\AI\venv\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in <module> import tensorflow as tf File "H:\Python\AI\venv\lib\site-packages\tensorflow\__init__.py", line 41, in <module> from tensorflow.python.tools import module_util as _module_util File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module> from tensorflow.python import pywrap_tensorflow File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "H:\Python\AI\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\Chan\AppData\Local\Programs\Python\Python37\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\Chan\AppData\Local\Programs\Python\Python37\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found. 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 above this error message when asking for help. Process finished with exit code 1
我必须尝试卸载、重新安装、升级、从 Python 3.8 更改为 3.7,...,但我仍然收到错误。
【问题讨论】:
标签: python python-3.x tensorflow keras