Python: Error loading dynamic library ‘cudart64_101.dll’ during tensorflow CPU-only installation

Posted by

Python: Could not load dynamic library ‘cudart64_101.dll’ on tensorflow CPU-only installation

Python: Could not load dynamic library ‘cudart64_101.dll’ on tensorflow CPU-only installation

If you are facing the error “Could not load dynamic library ‘cudart64_101.dll’ on tensorflow CPU-only installation” while using TensorFlow with Python, you are not alone. This error occurs when TensorFlow tries to load the CUDA runtime library (cudart64_101.dll) even though you have installed the CPU-only version of TensorFlow.

To fix this error, you can try the following steps:

  1. Make sure you have installed the CPU-only version of TensorFlow by running the following command:
  2. pip install tensorflow

  3. If you have the GPU version of TensorFlow installed, you can uninstall it by running:
  4. pip uninstall tensorflow-gpu

  5. Check if the CUDA runtime library (cudart64_101.dll) is present in your system. If it is, you can try renaming or removing it to prevent TensorFlow from trying to load it.
  6. Alternatively, you can set the environment variable ‘LD_LIBRARY_PATH’ to point to a directory where the CUDA runtime library is not present. This will prevent TensorFlow from trying to load the library.

By following these steps, you should be able to resolve the error “Could not load dynamic library ‘cudart64_101.dll’ on tensorflow CPU-only installation” and use TensorFlow with Python successfully.