简体   繁体   English

使用Anaconda导航器在Windows上导入Tensorflow时出错

[英]Error importing tensorflow on windows with anaconda navigator

I'm trying to import tensorflow and I have already tried everything and in the cmd prompt, I succeeded to install tensorflow with PIP. 我正在尝试导入tensorflow,并且已经尝试了所有方法,并且在cmd提示符下,我成功使用PIP安装了tensorflow。

命令nr 1

But when I'm trying to import tensorflow in Python, I get the following error: 但是当我尝试在Python中导入tensorflow时,出现以下错误:

  Error importing tensorflow.  Unless you are using bazel,
  you should not try to import tensorflow from its source directory;
  please exit the tensorflow source tree, and relaunch your python 
  interpreter
  from there.

I have tried everything on the internet, but nothing seems to fix it. 我已经尝试了互联网上的所有内容,但似乎没有任何解决方法。 I have Python version 3.7.1 我有Python版本3.7.1

What is the problem and more important: how can I fix this?? 问题是什么,更重要的是:我该如何解决?

First, if you have already installed tensorflow with pip, trying to install it again with conda is a bad idea. 首先,如果您已经使用pip安装了tensorflow,尝试使用conda再次安装它是一个坏主意。 Before running the conda command, first uninstall the pip version. 在运行conda命令之前,请先卸载pip版本。

pip uninstall tensorflow

That is an odd error you are seeing. 您看到的是一个奇怪的错误。 Try to specify the channel you are installing from. 尝试指定您要从中安装的频道。 It is available from both the anaconda and conda-forge channels 它可以从anaconda和conda-forge渠道获得

conda isntall tensorflow --channel anaconda

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM