ModuleNotFoundError: No module named ‘tfsnippet‘解决办法

项目场景:

debug的时候报错ModuleNotFoundError: No module named ‘tfsnippet’。

解决方案:

1.git下载tfsnippet,如链接所示https://gitee.com/obouluh/tfsnippet
2.需要使用git工具。安装方式如下:
1)在官网下载安装包:https://git-scm.com/downloads

在这里插入图片描述
在这里插入图片描述
2)按照默认选项安装git软件。
3)打开软件,输入指令:
首先安装tensorflow1.15以上版本。

pip install tensorflow==1.15.4 -i https://pypi.tuna.tsinghua.edu.cn/simple

安装依赖:

pip install git+https://github.com/thu-ml/zhusuan.git

在这里插入图片描述
安装 tfsnippet:

pip install git+https://github.com/haowen-xu/tfsnippet.git

如果报错则在install后面加上–user,赋予管理员权限,即如下指令:

pip install --user git+https://github.com/haowen-xu/tfsnippet.git

报错截图:
在这里插入图片描述
正确安装截图:
在这里插入图片描述
在这里插入图片描述
成功!

猜你喜欢

转载自blog.csdn.net/qq_38703529/article/details/124109463
今日推荐