Tensorflow2.0 ImportError: DLL load failed: 找不到指定的模块。

一.参考官网安装教程

TensorFlow

在这里插入图片描述

1.下载适用于 Visual Studio 2015、2017 和 2019 的 Microsoft Visual C++ 可再发行软件包
https://support.microsoft.com/zh-cn/topic/%E6%9C%80%E6%96%B0%E6%94%AF%E6%8C%81%E7%9A%84-visual-c-%E4%B8%8B%E8%BD%BD-2647da03-1eea-4433-9aff-95f26a218cc0
2.Enable NTFS long paths policy win10开启长路径
Hit the Windows key, type gpedit.msc and press Enter.
Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem 

在这里插入图片描述

# 重启电脑后 安装TensorFlow库
# pip install --upgrade pip
python -m pip install --upgrade pip
pip install -U tensorflow --trusted-host pypi.douban.com

二.运行相应程序

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import sklearn
import pandas as pd
import os
import sys
import time
import tensorflow as tf

print(tf.__version__)
print(sys.version_info)
for module in mpl, np, pd, sklearn, tf, tf.keras:
    print(module.__name__, module.__version__)

在这里插入图片描述

tensorflow2 ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。

enable-longpaths-windows
导入Tensorflow2.1.0出现ImportError: DLL load failed: 找不到指定的程序的解决办法
清华源安装tensorflow2.0

猜你喜欢

转载自blog.csdn.net/Cocktail_py/article/details/118276748
今日推荐