本站消息

站长简介/公众号


站长简介:逗比程序员,理工宅男,前每日优鲜python全栈开发工程师,利用周末时间开发出本站,欢迎关注我的微信公众号:幽默盒子,一个专注于搞笑,分享快乐的公众号

  价值13000svip视频教程,python大神匠心打造,零基础python开发工程师视频教程全套,基础+进阶+项目实战,包含课件和源码

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

在 conda 虚拟环境中安装 tensorflow 失败 - windows

发布于2021-07-30 15:05     阅读(250)     评论(0)     点赞(25)     收藏(0)



我创建了一个新的虚拟环境(称为 tensorflow_cpu)并且我刚刚安装了 tensorflow。

C:\Users\plain>conda create -n tensorflow_cpu pip python=3.6
C:\Users\plain>conda activate tensorflow_cpu
(tensorflow_cpu) C:\Users\plain>pip install --upgrade tensorflow

当我寻找 tensorflow 时,它看起来就在那里:

(tensorflow_cpu) C:\Users\plain>pip list --local
Package              Version
-------------------- -------------------
absl-py              0.9.0
astor                0.8.1
cachetools           4.0.0
certifi              2019.11.28
chardet              3.0.4
gast                 0.2.2
google-auth          1.11.2
google-auth-oauthlib 0.4.1
google-pasta         0.1.8
grpcio               1.27.2
h5py                 2.10.0
idna                 2.8
Keras-Applications   1.0.8
Keras-Preprocessing  1.1.0
Markdown             3.2.1
numpy                1.18.1
oauthlib             3.1.0
opt-einsum           3.1.0
pip                  20.0.2
protobuf             3.11.3
pyasn1               0.4.8
pyasn1-modules       0.2.8
requests             2.22.0
requests-oauthlib    1.3.0
rsa                  4.0
scipy                1.4.1
setuptools           45.2.0.post20200210
six                  1.14.0
tensorboard          2.1.0
tensorflow           2.1.0
tensorflow-estimator 2.1.0
termcolor            1.1.0
urllib3              1.25.8
Werkzeug             1.0.0
wheel                0.34.2
wincertstore         0.2
wrapt                1.12.0 

但是当我开始一个新的 python 解释器会话并尝试导入它时,我收到一条错误消息。

(tensorflow_cpu) C:\Users\plain>python
Python 3.6.10 |Anaconda, Inc.| (default, Jan  7 2020, 15:18:16) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-p   
ackages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-     
packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-   
packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 343, 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 "<stdin>", line 1, in <module>
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow\__init__.py", line  
101, in <module>
from tensorflow_core import *
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\__init__.py",   
line 42, in <module>
from . _api.v2 import audio
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-  
packages\tensorflow_core\_api\v2\audio\__init__.py", line 10, in <module>
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site- 
packages\tensorflow_core\python\ops\gen_audio_ops.py", line 9, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow\__init__.py", line   
50, in __getattr__
module = self._load()
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow\__init__.py", line  
44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\importlib\__init__.py", line 126, in   
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site- 
packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-  
packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-   
packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-
packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\site-
packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\plain\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 343, 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.

如果有人能告诉我发生了什么,我将不胜感激。我的操作系统是 windows (10)。

谢谢!


解决方案


暂无回答






所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/1006894/0d4a738ca4ca146e2099/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

25 0
收藏该文
已收藏

评论内容:(最多支持255个字符)