title: How to Correctly Install Tensorflow on Windows x64-bit Python 3.6.x
body: <p>When I first used <code>$ pip install --upgrade tensorflow</code>, I was unable to install it. After looking around on multiple sites, I realized that it was because I had installed the x32-bit version of Python, not the x64-bit. After uninstalling the old Python and installing the new one, I was able to install tensorflow. This was the output:</p>
  
  <pre><code>C:\Users\Seth&gt;pip install --upgrade tensorflow --user
  Collecting tensorflow
    Using cached https://files.pythonhosted.org/packages/0e/2a/c3fe6035f0a8726e5b210680af3ccaf826f4a64ce7306e57017aba749447/tensorflow-1.10.0-cp36-cp36m-win_amd64.whl
  Collecting six&gt;=1.10.0 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
  Collecting absl-py&gt;=0.1.6 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/a7/86/67f55488ec68982270142c340cd23cd2408835dc4b24bd1d1f1e114f24c3/absl-py-0.4.1.tar.gz
  Collecting gast&gt;=0.2.0 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/5c/78/ff794fcae2ce8aa6323e789d1f8b3b7765f601e7702726f430e814822b96/gast-0.2.0.tar.gz
  Requirement already satisfied, skipping upgrade: setuptools&lt;=39.1.0 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from tensorflow) (39.0.1)
  Collecting wheel&gt;=0.26 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
  Collecting protobuf&gt;=3.6.0 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/e8/df/d606d07cff0fc8d22abcc54006c0247002d11a7f2d218eb008d48e76851d/protobuf-3.6.1-cp36-cp36m-win_amd64.whl
  Collecting astor&gt;=0.6.0 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/35/6b/11530768cac581a12952a2aad00e1526b89d242d0b9f59534ef6e6a1752f/astor-0.7.1-py2.py3-none-any.whl
  Collecting tensorboard&lt;1.11.0,&gt;=1.10.0 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/c6/17/ecd918a004f297955c30b4fffbea100b1606c225dbf0443264012773c3ff/tensorboard-1.10.0-py3-none-any.whl
  Collecting grpcio&gt;=1.8.6 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/65/da/03e722b7981ab3222f292f735a3c157b1d1bca120c479d7e273273828170/grpcio-1.14.2-cp36-cp36m-win_amd64.whl
  Collecting termcolor&gt;=1.1.0 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
  Collecting numpy&lt;=1.14.5,&gt;=1.13.3 (from tensorflow)
    Using cached https://files.pythonhosted.org/packages/0d/b7/0c804e0bcba6505f8392d042d5e333a5e06f308e019517111fbc7767a0bc/numpy-1.14.5-cp36-none-win_amd64.whl
  Collecting markdown&gt;=2.6.8 (from tensorboard&lt;1.11.0,&gt;=1.10.0-&gt;tensorflow)
    Using cached https://files.pythonhosted.org/packages/6d/7d/488b90f470b96531a3f5788cf12a93332f543dbab13c423a5e7ce96a0493/Markdown-2.6.11-py2.py3-none-any.whl
  Collecting werkzeug&gt;=0.11.10 (from tensorboard&lt;1.11.0,&gt;=1.10.0-&gt;tensorflow)
    Using cached https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl
  Installing collected packages: six, absl-py, gast, wheel, protobuf, astor, numpy, markdown, werkzeug, tensorboard, grpcio, termcolor, tensorflow
    Running setup.py install for absl-py ... done
    Running setup.py install for gast ... done
    The script wheel.exe is installed in 'C:\Users\Seth\AppData\Roaming\Python\Python36\Scripts' which is not on PATH.
    Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    The script markdown_py.exe is installed in 'C:\Users\Seth\AppData\Roaming\Python\Python36\Scripts' which is not on PATH.
    Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    The script tensorboard.exe is installed in 'C:\Users\Seth\AppData\Roaming\Python\Python36\Scripts' which is not on PATH.
    Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Running setup.py install for termcolor ... done
    The scripts freeze_graph.exe, saved_model_cli.exe, tensorboard.exe, tflite_convert.exe, toco.exe and toco_from_protos.exe are installed in 'C:\Users\Seth\AppData\Roaming\Python\Python36\Scripts' which is not on PATH.
    Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Successfully installed absl-py-0.4.1 astor-0.7.1 gast-0.2.0 grpcio-1.14.2 markdown-2.6.11 numpy-1.14.5 protobuf-3.6.1 six-1.11.0 tensorboard-1.10.0 tensorflow-1.10.0 termcolor-1.1.0 werkzeug-0.14.1 wheel-0.31.1
  </code></pre>
  
  <p>I thought it had worked until I imported it in a program. This was the result of that:</p>
  
  <pre><code>&gt;&gt;&gt; import tensorflow as tf
  Traceback (most recent call last):
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
      return importlib.import_module(mname)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 658, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 571, in module_from_spec
    File "&lt;frozen importlib._bootstrap_external&gt;", line 922, in create_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in &lt;module&gt;
      from tensorflow.python.pywrap_tensorflow_internal import *
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in &lt;module&gt;
      _pywrap_tensorflow_internal = swig_import_helper()
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
      return importlib.import_module('_pywrap_tensorflow_internal')
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "&lt;pyshell#3&gt;", line 1, in &lt;module&gt;
      import tensorflow as tf
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 22, in &lt;module&gt;
      from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\__init__.py", line 49, in &lt;module&gt;
      from tensorflow.python import pywrap_tensorflow
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in &lt;module&gt;
      raise ImportError(msg)
  ImportError: Traceback (most recent call last):
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
      return importlib.import_module(mname)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 658, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 571, in module_from_spec
    File "&lt;frozen importlib._bootstrap_external&gt;", line 922, in create_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in &lt;module&gt;
      from tensorflow.python.pywrap_tensorflow_internal import *
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in &lt;module&gt;
      _pywrap_tensorflow_internal = swig_import_helper()
    File "C:\Users\Seth\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
      return importlib.import_module('_pywrap_tensorflow_internal')
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
  
  
  Failed to load the native TensorFlow runtime.
  
  See https://www.tensorflow.org/install/install_sources#common_installation_problems
  
  for some common reasons and solutions.  Include the entire stack trace
  above this error message when asking for help.
  </code></pre>
  
  <p>What did I do wrong?</p>