Меню Рубрики

Importerror no module named tensorflow windows

ImportError: No module named tensorflow — Can’t install Tensorflow #5478

Comments

Copy link Quote reply

paralaxwombat commented Nov 8, 2016 •

I am trying to install tensorflow on mac and it’s giving me this error.

ImportError: No module named tensorflow

Here is what I have done in the terminal

`sudo easy_install pip

After that I try to run python and tensorflow to check my installation. It doesn’t work. I have spent 3 hours on the problem.

aselle commented Nov 8, 2016

Please consider these things:

  • What OS? We support El Capitan right now. Sierra hopefully soon.
  • Try a newer version than 0.9 which is quite old, perhaps 0.11rc2
  • Are there any errors on the pip install?
  • What version of python. Perhaps try the python 2 version if you have that as well. Show exactly what version of python you are actually running and what it spits out. For example.

I understand it is frustrating to spend 3 hours having trouble, but it is hard for us to help you when you do not provide detailed information. Thanks.

LeongKH commented Nov 26, 2016 •

THIS IS SOLVED, SEE BOTTOM COMMENT
I am having the same error too.
I am using EI Capitan 10.11.2

Here is what i did in my installation, no error during the installation:

Here is my tensor flow information:

here is my protobuf information:

here is my six information:

Following is my python version:

UPDATE: It seems that my pip is link to python 2.7.12 (previously installed via Homebrew). I uninstall everything, and reinstall to solve the issue

prb12 commented Nov 27, 2016

rezafarhadi commented Jan 28, 2017

I had the same issue with mac os.. this fixed the problem:
install brew
brew install python
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl
sudo pip install —upgrade $TF_BINARY_URL

UkiDLucas commented Feb 1, 2017 •

  • brew install python — installs 2.7
  • brew install python3 — installs 3.6
    in any case, you are not running optimal version for TensorFlow 3.5

Anyway,
$ python —version
Python 3.5.2 :: Continuum Analytics, Inc.

When running:
$ sudo pip3 install —ignore-installed —upgrade $TF_BINARY_URL

it looks like it installs everything 100%
$ conda list
.
tensorflow-gpu 0.12.1
.

but when running $ jupyter notebook
import tensorflow as tf
ModuleNotFoundError: No module named ‘tensorflow’

For Jupyter kernel to reflect changes in conda env (tensorflow), I had to set up the following:

lingfengchencn commented Feb 22, 2017

i had the same issue. and here is why it happen and how i fixed it in my issue:
env: anaconda (python 3.6)+mac ,
first ,i used :
$ pip3 install tensorflow
$ python
Python 3.6.0 |Anaconda 4.3.0 (x86_64)| (default, Dec 23 2016, 13:19:00)

ModuleNotFoundError: No module named ‘tensorflow’

and then
$pip install tensorflow
$python
Python 3.6.0 |Anaconda 4.3.0 (x86_64)| (default, Dec 23 2016, 13:19:00)

gsanjeevkumar commented Mar 12, 2017

@LeongKH thanks this works for me!

saramelvin commented Apr 29, 2017

importing tensorflow using python3 instead of python 2.7 worked for me.

KiselevMaxim commented Jun 13, 2017

pip3 install tensorflow
.
pip install tensorflow

thank you, it is works for me

johndpope commented Aug 8, 2017

some computer scientist lady recommended miniconda — and I haven’t looked back.
Forget using pip/pip3 / use conda + conda environments. I can’t recommend it more.
https://gist.github.com/johndpope/187b0dd996d16152ace2f842d43e3990

andyhappy1 commented Aug 23, 2017

@UkiDLucas Thanks very much. That fixed it for me. I believe it’s that you need iPython to make Python 2.7 work with Anaconda.

This fixed it for me:
$source activate tensorflow
$ sudo pip install ipykernel
$ python -m ipykernel install —user —name tensorflow —display-name «conda env tensorflow»

armotodo commented Sep 19, 2017

armotodo commented Sep 19, 2017

Afrogeek254 commented Oct 28, 2017

Hi i have the same issue when trying to run tensorflow in my windows 10
when I run pip show cmd this is what is displayed
C:>pip show tensorflow
Name: tensorflow
Version: 1.3.0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: c:\program files\python36\lib\site-packages
Requires: six, wheel, tensorflow-tensorboard, numpy, protobuf

when prompt my python shell and try to import tensorflow

it gives me this error

import tensorflow as tf
Traceback (most recent call last):
File «», line 1, in
ModuleNotFoundError: No module named ‘tensorflow’

renying commented Dec 19, 2017

i had the same issue.
i installed two version of python 2.7 and 3.5
tensorflow installs in python2.7

my default python version is 3.5
so if I type: python
Python 3.5.3 (default, Dec 7 2017, 09:41:57)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type «help», «copyright», «credits» or «license» for more information.

import tensorflow as tf
Traceback (most recent call last):
File «», line 1, in
ImportError: No module named ‘tensorflow’

but if I type: python2.7
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type «help», «copyright», «credits» or «license» for more information.

so check your python version.
It will help

Источник

ImportError: No module named ‘tensorflow’ on windows + anaconda #6136

Comments

Copy link Quote reply

ghost commented Dec 7, 2016

I followed the instructions on downloading and setting up tensorflow on windows. they result in one red line on the pip installation and the no-module-found error message in python interactive.

the pip installation ends with a line printed in red:
«Cannot remove entries from nonexistent file c:\users\jesaremi\appdata\local\continuum\anaconda3\lib\site-packages\easy-install.pth»

  • open up python and type «import tensorflow as tf»:

import tensorflow as tf
Traceback (most recent call last):
File «», line 1, in
ImportError: No module named ‘tensorflow’

ghost commented Dec 7, 2016

I also checked the c++ runtime as mentioned in the doc page. I have the exact same thing already installed

ghost commented Dec 7, 2016

here’s the entire pip install log:
pip install —upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
Collecting tensorflow==0.12.0rc0 from https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
Downloading https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl (12.2MB)
100% |################################| 12.2MB 112kB/s
Collecting protobuf==3.1.0 (from tensorflow==0.12.0rc0)
Downloading protobuf-3.1.0-py2.py3-none-any.whl (339kB)
100% |################################| 348kB 1.6MB/s
Collecting numpy>=1.11.0 (from tensorflow==0.12.0rc0)
Downloading numpy-1.11.2-cp35-none-win_amd64.whl (7.6MB)
100% |################################| 7.6MB 183kB/s
Requirement already up-to-date: six>=1.10.0 in c:\users\jesaremi\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow==0.12.0rc0)
Requirement already up-to-date: wheel>=0.26 in c:\users\jesaremi\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow==0.12.0rc0)
Collecting setuptools (from protobuf==3.1.0->tensorflow==0.12.0rc0)
Downloading setuptools-30.2.0-py2.py3-none-any.whl (472kB)
100% |################################| 481kB 2.1MB/s
Installing collected packages: setuptools, protobuf, numpy, tensorflow
Found existing installation: setuptools 27.2.0
Cannot remove entries from nonexistent file c:\users\jesaremi\appdata\local\continuum\anaconda3\lib\site-packages\easy-install.pth

Carmezim commented Dec 7, 2016 •

This seems an Anaconda issue. Could you please:

Upgrade setuptools:
pip install —upgrade -I setuptools

Install TensorFlow again with —ignore-installed flag:
pip install —ignore-installed —upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl

and see if it solves the problem?

EDIT: At the time of this answer TensorFlow last release was still 0.12 so I updated the wheel version to 1.0.

Carmezim commented Dec 7, 2016 •

@mrry should I submit a PR to get_started docs with a note about this anaconda issue when pip is trying to remove easy-install.pth and it does not exist in a new Anaconda installation as conda packages can’t include it?

ghost commented Dec 7, 2016

Adriano, the setuptools upgrade fixed everything. thanks very much

mrry commented Dec 7, 2016

@Carmezim That would be a great addition to the «Common Problems» section, thanks!

Источник

ImportError: No module named tensorflow

Please help me with this error

I have installed the tensorflow module on my server and below is it’s information

But when I try to import tensorflow I get following error

My python version is as following

I have tried the solutions given in sol1

I do not have sudo access to the server I can only use pip to install any module

18 Answers 18

Try installing tensorflow again with the whatever version you want and with option —ignore-installed like:

I solved same issue using this command.

I had a more basic problem when I received this error.

The «Validate your installation» instructions say to type: python

However, I have both 2.7 and 3.6 installed. Because I used pip3 to install tensorflow, I needed to type: python3

Using the correct version, I could import the «tensorflow» module.

Check if Tensorflow was installed successfully using:

If you get something like

You may try adding the path of your tensorflow location by:

For Anaconda3, simply install in Anaconda Navigator:

Try installing tensorflow in the user site — This installation only works for you.

You may need this since first one may not work.

python3 -m pip install —upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

you might wanna try this:

with python2

pip show tensorflow to check install

python test.py to run test

with python3

pip3 show tensorflow to check install

python3 test.py to run test

test.py

Or, if you haven’t install tensorflow yet, try the offical document

I was trying to install tensorflow GPU for a Windows 7 with pip3 for python3.5.x. Instead of doing pip3 install —upgrade tensorflow I just did pip install tensorflow and after it completed i was finally able to import tensorflow in python3.5.x.

Instead of using the doc’s command ( conda create -n tensorflow pip python=2.7 # or python=3.3, etc. ) which wanted to install python2.7 in the conda environment, and kept erroring out saying the module can’t be found when following the installation validation steps, I used conda create -n tensorflow pip python=3 to make sure python3 was installed in the environment.

Doing this, I only had to type python instead of python3 when validating the installation and the error went away.

Try Anaconda install steps from TensorFlow docs.

Activate the virtualenv environment by issuing one of the following commands:

/tensorflow/bin/activate # bash, sh, ksh, or zsh
$ source

/tensorflow/bin/activate.csh # csh or tcsh

This Worked for me:

In my case, I install 32 Bit Python so I cannot install Tensorflow, After uninstall 32 Bit Python and install 64 Bit Python , I can install tensorflow successfully.

After reinstall Python 64 bit , you need to check your python install folder path is properly set in Windows Environment Path.

You can check Python version by typing python in cmd.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Iis authentication windows authentication
  • Iis arr on windows server 2012 r2 standard
  • Igra windows 7 для windows 7 skachat besplatno
  • Igfxtray exe что это за процесс windows 7
  • Igfxpers exe что это за процесс windows 7