[Python] Trouble loading tensorflow when running cloned repo

Discussão em 'Python' iniciado por Stack, Abril 25, 2025.

  1. Stack

    Stack Membro Participativo

    So, I'm trying to get the code from this repo https://github.com/amin20/GBM_WSSM working but I'm running into a persistent error.

    Using TensorFlow backend.
    Traceback (most recent call last):
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\tensorflow\python\platform\self_check.py", line 47, in preload_check
    ctypes.WinDLL(build_info.msvcp_dll_name)
    File "C:\Users\trans\AppData\Roaming\uv\python\cpython-3.7.9-windows-x86_64-none\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
    OSError: [WinError 126] The specified module could not be found

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "0_main.py", line 7, in <module>
    import keras
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\keras\utils\__init__.py", line 6, in <module>
    from . import conv_utils
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>
    from .. import backend as K
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\keras\backend\__init__.py", line 89, in <module>
    from .tensorflow_backend import *
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>
    import tensorflow as tf
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
    self_check.preload_check()
    File "C:\Users\trans\source\repos\GBM_WSSM\.venv\lib\site-packages\tensorflow\python\platform\self_check.py", line 55, in preload_check
    % build_info.msvcp_dll_name)
    ImportError: Could not find 'msvcp140.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. You may install this DLL by downloading Visual C++ 2015 Redistributable Update 3 from this URL: https://www.microsoft.com/en-us/download/details.aspx?id=53587


    I've looked for solutions and tried downloading the Visual C++ 2015 redistributable and I know the correct DLL (msvcp140.dll) is in the system32 folder and that my system32 folder is in my users PATH variable.

    However, I'm still getting this error whenever I try and run the main python script. I'm using a virtual environment with python 3.7.9 with packages keras==2.2.4, pillow>=9.5.0, and tensorflow==1.13.1. My OS is Windows 10 pro. Any help would really be appreciated!

    Continue reading...

Compartilhe esta Página