0

I installed tensorflow in Windows 7 (32 bit) with Anaconda according to the instructions given here. But when trying to import tensorflow, I get the following error:

(tensorflow) C:\Users\h473>python
Python 3.5.5 |Anaconda, Inc.| (default, Apr  7 2018, 04:53:16) [MSC v.1900 32 bi
t (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_imp
ort_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [
dirname(__file__)])
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\imp.
py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>

    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_imp
ort_helper
    import _pywrap_tensorflow_internal
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_imp
ort_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [
dirname(__file__)])
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\imp.
py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>

    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\h473\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site
-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_imp
ort_helper
    import _pywrap_tensorflow_internal
ImportError: No module named '_pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_probl
ems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
>>>

I also tried installing it like so:

pip install tensorflow

But this did not even install tensorflow; it gives the following error:

Collecting tensorflow
  Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

Please suggest what's the problem and how to solve it.

Martin Thoma
  • 91,837
  • 114
  • 489
  • 768
Kristada673
  • 2,895
  • 3
  • 21
  • 59
  • can you add traceback of `pip install tensorflow`? What error is this showing? – harshil9968 May 02 '18 at 09:16
  • @harshil9968 edited the question details at the end to include the exact error. – Kristada673 May 02 '18 at 09:20
  • https://gist.github.com/diarabit/17d9051f9505c9d554d8a7d0c2bc4eb1, try running this script on your system – harshil9968 May 02 '18 at 09:21
  • @harshil9968 It gives the same error, "ERROR: Failed to import the TensorFlow module.", and also points out that tensorflow-gpu files are missing, but I don't want tensorflow-gpu, I want tensorflow with only CPU. – Kristada673 May 02 '18 at 09:25
  • upgrade your pip too, download **get-pip.py** https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows – harshil9968 May 02 '18 at 09:39
  • @harshil9968 done already; performed all the steps mentioned in the forums related to this problem. Could the problem be arising due to the 32 bit Windows 7? – Kristada673 May 02 '18 at 09:44

1 Answers1

0

This is one of the questions posted on Tensorflow installation page under Common Installation Problems section, maybe you can try the solutions provided in the linked SO question.

As for pip installation not working, maybe you should try: python -m pip install tensorflow.

Hope this helps.

  • Performed all the solutions proposed in this forum, the error persists. – Kristada673 May 02 '18 at 09:58
  • Might be an issue with 32-bit architecture, as this question shows [link](https://stackoverflow.com/questions/44449972/how-to-install-tensorflow-for-windows-7-32bit-systemi-installed-python-3-532-b). – Ankit Paliwal May 02 '18 at 10:38
  • You might check out this post about setting up tensorflow on a 32-bit ARM architecture [blog](http://cudamusing.blogspot.in/2015/11/building-tensorflow-for-jetson-tk1.html) – Ankit Paliwal May 02 '18 at 10:39