---
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”。"
url: https://www.hiascend.com/document/detail/zh/TensorFlowCommercial/latest/migration/tfmigr2/tfmigr2_000109.html
sourcePath: /source/zh/TensorFlowCommercial/900/migration/tfmigr2/tfmigr2_000109.html
indexId: 1f28161f57b08f08a0c4980d74067016f77eba5501ca20e3b00da49a83bc03d073
---
# 安装TensorFlow 2.6.5后，执行import tensorflow时报错

#### 问题描述

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

图1 报错截图


#### 可能原因

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


#### 解决措施

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

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