tensorflow: Installation of tensorflow 2.0 cpu on windows 10 not working
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10 64 bit
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: n/a
- TensorFlow installed from (source or binary): pip install tensorflow
- TensorFlow version (use command below): 2.0.0
- Python version: 3.7.4
- Bazel version (if compiling from source): n/a
- GCC/Compiler version (if compiling from source): n/a
- CUDA/cuDNN version: n/a
- GPU model and memory: n/a
You can collect some of this information using our environment capture
script
You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"
Describe the current behavior Installation of tensorflow 2.0 cpu on windows 10 not working. I’m unable to import tensorflow. Describe the expected behavior Run the command "python -c “import tensorflow as tf” within conda CLI without error. Code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. 1) #from conda CLI base create new environment conda create --name tensorflow2_test 2) #activate environment conda activate tensorflow2_test 3) #install pip conda install pip 4) #install environment tensorflow 2.0 pip install tensorflow 5) #verify install: python -c “import tensorflow as tf”
Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
error trace:
(tensorflow2_test) C:\~\install environment\production>python -c "import tensorflow as tf"
Traceback (most recent call last):
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Anaconda3\envs\tensorflow2_test\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Anaconda3\envs\tensorflow2_test\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
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 "<string>", line 1, in <module>
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
    from tensorflow_core import *
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
    module = self._load()
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow\__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "C:\Anaconda3\envs\tensorflow2_test\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Anaconda3\envs\tensorflow2_test\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Anaconda3\envs\tensorflow2_test\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Anaconda3\envs\tensorflow2_test\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
(tensorflow2_test) C:\~\install environment\production>
package list:
(tensorflow2_test) C:~\install environment\production>conda list
packages in environment at C:\Anaconda3\envs\tensorflow2_test:
Name Version Build Channel
absl-py 0.8.1 pypi_0 pypi astor 0.8.0 pypi_0 pypi ca-certificates 2019.8.28 0 certifi 2019.9.11 py37_0 gast 0.2.2 pypi_0 pypi google-pasta 0.1.7 pypi_0 pypi grpcio 1.24.1 pypi_0 pypi h5py 2.10.0 pypi_0 pypi keras-applications 1.0.8 pypi_0 pypi keras-preprocessing 1.1.0 pypi_0 pypi markdown 3.1.1 pypi_0 pypi numpy 1.17.2 pypi_0 pypi openssl 1.1.1d he774522_2 opt-einsum 3.1.0 pypi_0 pypi pip 19.2.3 py37_0 protobuf 3.10.0 pypi_0 pypi python 3.7.4 h5263a28_0 setuptools 41.4.0 py37_0 six 1.12.0 pypi_0 pypi sqlite 3.30.0 he774522_0 tensorboard 2.0.0 pypi_0 pypi tensorflow 2.0.0 pypi_0 pypi tensorflow-estimator 2.0.0 pypi_0 pypi termcolor 1.1.0 pypi_0 pypi vc 14.1 h0510ff6_4 vs2015_runtime 14.16.27012 hf0eaf9b_0 werkzeug 0.16.0 pypi_0 pypi wheel 0.33.6 py37_0 wincertstore 0.2 py37_0 wrapt 1.11.2 pypi_0 pypi
(tensorflow2_test) C:~\install environment\production>
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 25 (4 by maintainers)
Can you check your CPU to see if it supports AVX, please?
Installation of TensorFlow 2.0.0 using conda was successful and in addition TensorFlow import was successful. Why does conda env work fine but pip env don’t?
Detail:
tensorflow2_0_conda environment: conda installation using
conda install python=3.7 tensorflow=2.0Installation completed without any error.
Import test: conda successfully imported tensorflow
python -c "import tensorflow as tf"tests anaconda :
tensorflow 2.0 import failed:
python -c “import tensorflow as tf”
detail:
#CLI anaconda; default path: C:\Users~ #optional: explore tensorflow runtime #test target: cd into following directory C:\Anaconda3\envs\tensorflow2_env\Lib\site-packages\tensorflow_core\python C:\Anaconda3\envs\tensorflow_1_14_env\Lib\site-packages\tensorflow\python
#activate environment conda activate tensorflow2_env conda activate tensorflow_1_14_env deactivate
#tensorflow 1.14 #all imports successful python -c “import tensorflow as tf” python -c “import tensorflow.python.pywrap_tensorflow” python -c “import tensorflow.python.pywrap_tensorflow_internal” #import .pyd file; C+±object code python -c “import tensorflow.python._pywrap_tensorflow_internal”
#tensorflow 2.0 #all imports fail python -c “import tensorflow as tf” python -c “import tensorflow.python._pywrap_tensorflow_internal”
#optional #list packages conda list conda list tensorflow conda list python