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:
- Make sure you have installed the CPU-only version of TensorFlow by running the following command:
- If you have the GPU version of TensorFlow installed, you can uninstall it by running:
- 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.
- 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.
pip install tensorflow
pip uninstall tensorflow-gpu
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.