简体   繁体   中英

Jupyter-notebook numpy.core.umath failed to import

Jupyter notebook raised "numpy.core.umath failed to import" error when I imported tensorflow.But, It can be imported correctly in other situation,such as CMD and pycharm.

tf2 is a conda virtual env

I used ipykernel mapping conda virtual env to jupyter notebook.

python3 -m ipykernel install --user --name tf2 --display-name tf2

numpy 1.16.4
tensorflow 2.0.0a0
tensorflow-gpu 2.0.0a0
tensorlayer 2.1.0

I tried to change numpy version to 1.16.3+mkl,the problem still existence.

import tensorflow as tf
print(tf.__version__)

here is the error info

ModuleNotFoundError Traceback (most recent call last) ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

ModuleNotFoundError Traceback (most recent call last) ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

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

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

Have you activated the conda environment before starting Jupyter? Or are you relying on the Anaconda kernel provider, which finds kernels in different environments and activates the environment when starting the kernel?

If neither, try one of those.

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