python-3.x - 错误:安装 tensorflow 时由于 EnvironmentError 无法安装软件包
问题描述
我正在尝试跟随此处的 AI 教程:https ://www.youtube.com/watch?v=WFr2WgN9_xE
但是在 11:56,当他运行程序时,我收到了这个错误:
Traceback (most recent call last):
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Joshua\anaconda3\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\Joshua\anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Joshua\anaconda3\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 "C:/Users/Joshua/PycharmProjects/ tensorEnv/test.py", line 1, in <module>
import tensorflow
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Joshua\anaconda3\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\Joshua\anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Joshua\anaconda3\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.
我尝试使用 重新安装 tensorflow pip install tensorflow
,但出现此错误:
ERROR: Could not install packages due to an EnvironmentError:
[Errno 2] No such file or directory: 'C:\\Users\\Joshu
a\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37
\\site-packages\\tensorboard_plugin_wit\\_vendor\\tensorflow_serving\\sources\\storage_path\\__pycache__\\file_syste
m_storage_path_source_pb2.cpython-37.pyc'
有人知道如何解决这个问题吗?
解决方案
我修好了它!我用pip install tensorflow==1.15.2
. 感谢@Micheal Chen 向我展示了一个类似问题的链接
推荐阅读
- python - Python 类和方法 - 访问和更改属性的最佳实践?
- angular - 角度选择选项 - 使用对象数组中的值填充下拉列表
- javascript - 如何在 BigQuery 中使用“2020 年 5 月 11 日星期一 11:22:19 GMT+0000(协调世界时)”作为日期
- android-studio - 如何从 EditText 编写 Android 外部 Excel 文件?
- opengl - 如何更改OpenGL中的视图透视?
- node.js - 错误:querySrv ETIMEOUT _mongodb._tcp。当我连接到我的家庭路由器网络时
- caching - AutoProtoSchemaBuilder 没有生成原型文件
- angular - 如何在 Angular 中使用 subscribe-next RxJS?
- keycloak - keycloak 是否提供了一种区分同一用户在不同设备上的登录的方法
- python-3.x - boto3 dynamodb 扫描过滤器在 demicals 中的日期时间纪元之间