我目前正在尝试pip install tensorflow
,这个命令可以正常工作。但是在我安装完成之后,通过import tensorflow as tf
将其导入到我的Python模块时,我会遇到以下错误消息:
ImportError: Could not find the DLL(s) 'msvcp140_1.dll'. TensorFlow requires that
these DLLs be installed in a directory that is named in your %PATH% environment
variable. You may install these DLLs by downloading "Microsoft C++ Redistributable
for Visual Studio 2015, 2017 and 2019" for your platform from this URL:
https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads
我安装了msvcp140_1.dll
并将其放入C:\Users\User\AppData\Local\Programs\Python\Python37
,该路径已包含在我的环境变量中。
正如您所看到的,我正在使用Python 3.7,因为Tensorflow不支持3.8。 有什么想法如何解决这个问题吗?