ModuleNotFoundError: No module named 'tf_explain'

ModuleNotFoundError: No module named 'tf_explain'

我正在尝试安装 tf-explain。所以在安装 anaconda 和 tensorflow 之后,我现在正在尝试安装 tf-explain 所以我已经使用了:

pip install tf-explain
and 
pip3 install tf-explain

结果:

Alt@mx:~
$ pip install tf-explain
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: tf-explain in ./.local/lib/python3.7/site-packages (0.3.0)
Alt@mx:~
$ pip3 install tf-explain
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: tf-explain in ./.local/lib/python3.7/site-packages (0.3.0)
Alt@mx:~

但是当我在 spyder 中尝试导入这个时:

from tf_explain.callbacks.activations_visualization import ActivationsVisualizationCallback

我收到这个错误:

ModuleNotFoundError: No module named 'tf_explain'

我使用的是conda基础环境

我在 Windows 和 Linux (colab) os 上测试过,它有效。

!pip install opencv-python
!pip install tensorflow

import cv2                  
import tensorflow as tf 

tf.__version__, cv2.__version__
('2.4.1', '4.1.2')

!pip install tf-explain
Collecting tf-explain
Downloading 
Installing collected packages: tf-explain
Successfully installed tf-explain-0.3.0

from tf_explain.utils.display import filter_display
from tf_explain.callbacks.activations_visualization import ActivationsVisualizationCallback

您的问题可能涉及 设置。