Error trying to run TensorFlow: ImportError: DLL load failed while importing_pywrap_tensorflow_internal

Asked 1 years ago, Updated 1 years ago, 40 views

When trying to determine or run the version of TensorFlow, an error similar to the following appears:
I've tried and tried, but it hasn't gone down at all.Please let me know if there are any countermeasures.

Run Environment

< u l >
  • Anaconda 1.9.12
  • Python 3.8
  • Tensorflow< - The version is unknown.When I try to find out, I get the following error
  • What I've tried so far いずれNone of them worked

    < u l >
  • uninstalled and reinstalled
  • Tried installing with the conda command
  • Error Output

    (tensorflow)PSC:\Users\Atsuhito.Ito>python-c "import tensorflowastf;print(tf.__version__)"
    Traceback (most recent call last):
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in<module>
        from tensorflow.python._pywrap_tensorflow_internal import*
    ImportError: DLL load failed while importing_pywrap_tensorflow_internal—The specified module cannot be found.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\_init__.py", line 41, in <module>
        from tensorflow.python.tools import module_util as_module_util
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\_init__.py", line 40, in<module>
        from tensorflow.python.eager import context
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\eager\context.py", line 35, in<module>
        from tensorflow.python import pywrap_tfe
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in<module>
        from tensorflow.python import pywrap_tensorflow
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in<module>
        raise ImportError(msg)
    ImportError: Traceback (most recent call last):
      File "C:\Users\Atsuhito.Ito\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in<module>
        from tensorflow.python._pywrap_tensorflow_internal import*
    ImportError: DLL load failed while importing_pywrap_tensorflow_internal—The specified module cannot be found.
    
    
    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.
    (tensorflow) PCS:\Users\Atsuhito.Ito>
    

    python python3 tensorflow

    2022-09-30 17:04

    1 Answers

    The comment says it will be resolved, so I will write it down as an answer.

    Perhaps the TensorFlow that Windows Anaconda can install at this time is a 2.1.0 version that does not support Python 3.8.

    Below is the current Anaconda package information
    anaconda/packages/tensorflow 2.2.0

    Installers
    conda install
    linux-64 v2.2.0
    win-64 v2.1.0
    osx-64 v2.0.0
    To install this package with condalun:

    conda install-canaconda tensorflow
    

    Article that TensorFlow running Python 3.8 is 2.2 or later
    How to install TensorFlow with Python 3.8

    As of May 7, 2020, recording to Tensorflow's Installation page with pip, Python 3.8 is now supported. Python 3.8 support requirements TensorFlow 2.2 or later.
    You should be able to install it normally via pip.

    Prior to May 2020:
    As you mentioned, it is currently not supported by Python 3.8, but is by Python 3.7.
    You want to have virtualenv installed. You need Python 3.7. Then you can just start avirtualenv with -python 3.7 and installing it using pipe like you did before:
    Omitted below

    The solution may be to work with Linux or install with pip, but the easiest way is to create a Python 3.6 environment and install TensorFlow, although the number of versions of TensorFlow is getting older.

    I think this article will be helpful.
    Remembering to build your own Miniconda environment


    2022-09-30 17:04

    If you have any answers or tips


    © 2024 OneMinuteCode. All rights reserved.