---
title: 安装TensorFlow 2.6.5后，执行import tensorflow时报错-昇腾社区
description: 安装TensorFlow 2.6.5后，执行import tensorflow时报错：“RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd”。
keywords: TensorFlow2.6.5;import tensorflow;RuntimeError
url: https://www.hiascend.com/document/caselibrary/detail/tensorflow_faq_0015
section: (其他)
---

# 安装TensorFlow 2.6.5后，执行import tensorflow时报错-昇腾社区

URL: https://www.hiascend.com/document/caselibrary/detail/tensorflow_faq_0015
描述: 安装TensorFlow 2.6.5后，执行import tensorflow时报错：“RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd”。
关键词: TensorFlow2.6.5;import tensorflow;RuntimeError

昇腾文档 [了解详情](https://www.hiascend.com/document)

故障案例 [了解详情](https://www.hiascend.com/document/caselibrary)

安装TensorFlow 2.6.5后，执行import tensorflow时报错

安装TensorFlow 2.6.5后，执行import tensorflow时报错

2025/03/28

547

问题信息

| 问题来源 | 产品大类 | 产品子类 | 关键字 |
| --- | --- | --- | ---|
| 官方 | 模型训练 | TensorFlow | TensorFlow2.6.5、import tensorflow、RuntimeError |

#### 问题现象描述

安装TensorFlow 2.6.5后，执行import tensorflow时报错：“RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd”。

#### 可能原因

pip3安装TensorFlow的时候，可能会自动重装numpy，导致TensorFlow和numpy版本不兼容，需用户手动重装numpy。

#### 解决措施

执行如下命令卸载旧版本numpy，安装TensorFlow 2.6.5适配的numpy 1.23.0版本。

```
pip3 uninstall numpy
pip3 install numpy==1.23.0
```

本页内容

- 问题信息
- 问题现象描述
- 可能原因
- 解决措施
