简体   繁体   中英

Import Error in Tensorflow in Jupyter Notebook

I have anaconda installed in my computer. I have installed all modules of tensorflow in it. I am trying to import tensorflow from jupyter notebook , but i am getting following error.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

Can anyone help me solve this error ?

It is an error of updating numpy library.

I upgraded numpy using folowing command,

pip install numpy --upgrade

and the problem solved.

在此输入图像描述

From the Traceback, the Import error is being raised because your current version of numpy is not compatible with Tensorflow. Updating the numpy package should fix this.

Try this in Anaconda Prompt:

conda update numpy

Useful Links:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM