Tensorflow import error: no module named "tensorflow"

I installed TensorFlow in my Windows Python 3.5 Anaconda environment. Verification was successful (with warning)

(tensorflow) C:\>python

Python 3.5.3 | Intel Corporation | (default, April 27, 2017 5:03:30 PM) [MSC v.1900 64 bit (AMD64)] on win32

Enter “help,” “copyright,” “loans,” or “license” for more information. Intel (R) Distribution for Python is provided to you by Intel. Please check: https://software.intel.com/en-us/python-distribution

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()

2017-10-04 11: 06: 13.569696: WC: \ tf_jenkins \ home \ workspace \ rel-win \ M \ windows \ PY \ 35 \ ensorflow \ core \ platform \ cpu_feature_guard.cc: 45] The TensorFlow library was not compiled for use AVX instructions, but they are available on your computer and can speed up processor calculations.

>>> print(sess.run(hello))

Hi Tensor Stream!

However, when I try to import it into my Python code

from __future__ import print_function, division
import numpy as np
import os
import matplotlib
import tensorflow as tf

I get this error

ImportError: no module named tenensflow

This is the location of the tenorflow package on my C drive

C:\Users\myname\Anaconda2\envs\tensorflow\Lib\site-packages\tensorflow

When I go into Anaconda Navigator, it seems to me that I need to choose root, Python35 or Tensorflow. It looks like the Tensorflow environment includes Python35.

Anaconda Navigator , , - Tensorflow. , Tensorflow IDE Anaconda/Spyder, Navigator,

conda create --name tensorflow python=3.5; 
pip install --ignore-installed --upgrade tensorflow 

: protobuf,

, SO ,

+14
7

, Python 3.5 Tensorflow, , Anaconda tenorflow .

Anaconda , TensorFlow, Spyder.

conda create -n newenvt anaconda python=3.5
activate newenvt

newenvt

+14

Windows 64, :

Anaconda:

conda create -n tensorflow python=3.5
activate tensorflow
pip install --ignore-installed --upgrade tensorflow

, tensorflow. Spyder tensorflow - :

conda install spyder

Spyder Tensorflow. scipy, matplotlib, pandas, sklearn . OpenCV.

"conda install" "pip".

+5

, Python Tensorflow, , Anaconda tenorflow .

Anaconda, TensorFlow, :

conda create -n newenvt anaconda python=python_version

python_version python

:

activate newenvt

(newenvt) :

conda install tensorflow

, Python, .

import tensorflow
+4

, . shadoworflow - virtualenv, tenorflow Tensorflow . invironment anypython script .

+3

64- Windows, . , Python 32- 64- . 32-, (, Python - 3.7.3) https://www.python.org/downloads/release/python-373/ → "" " Windows x86-64". .

tenorflow : https://www.tensorflow.org/install/pip. , -...

0

pip-

pip install tensorflow

conda-

conda install tensorflow

, .

0

remove tenorflow from cDrive / users / envs / tenorflow and after that

conda create -n tensorflow python=3.6
 activate tensorflow
 pip install --ignore-installed --upgrade tensorflow

now it works for new versions of python thanks

0
source

Source: https://habr.com/ru/post/1686896/


All Articles