我按照 TensorFlow 网站中给出的说明安装 tensorflow_hub 并将其安装在 conda 环境中。
$ pip install "tensorflow>=2.0.0"
$ pip install --upgrade tensorflow-hub
我在 anaconda prompt 中运行了上面的命令但我仍然收到
ModuleNotFoundError
对于“tensorflow_hub”。任何帮助在这里表示赞赏。提前致谢
最佳答案
第一件事
检查您是否在该环境中安装了 tensorflow_hub
conda list
如果你在那里找不到它,也许你已经将它安装到另一个无关紧要的环境,只需在此处重新安装即可。pip install tensorflow_hub
您可能已经这样做了 所以很可能您在 jupyter notebook 中使用了另一个内核,所以要么转到该内核的环境并在那里安装您的软件包。或者首选方式,安装您当前的环境 yourenvironment
作为新内核并在您的 jupyter notebook 中使用该内核 python -m ipykernel install --user --name=yourenvironment
现在启动您的 jupyter notebook 并享受您的包裹
关于python - ModuleNotFoundError: 没有名为 'tensorflow_hub' 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63884339/