用python发布到wordpress提示:AttributeError: module 'frontmatter' has no attribute 'load'

最近用研究自动化推文,用python发布到wordpress:需要用到wordpress_xmlrpc,frontmatter,markdown2

安装时frontmatter,用了:pip3 install frontmatter

提示:Successfully installed frontmatter-3.0.7

运行脚本提示:AttributeError: module 'frontmatter' has no attribute 'load'

上网搜了下发现用错包名了,用这个安装即可:pip install python-frontmatter

我遇到了与frontmatter软件包相关的相同问题,但不适用于此存储库。我不确定我的解决方案是否适合您。
一开始,它报告同样的错误,

AttributeError:“模块”对象没有属性“负载”

对于frontmatter.load(),我也安装了frontmatter==3.0.5,但最后我发现还有另一个frontmatter包,https://pypi.org/project/python-frontmatter/,它是安装的

pip install python-frontmatter

如果我卸载frontmatter==3.0.5并安装python-frontmatter,那么问题就解决了。

暂无评论

发表评论

您的电子邮件地址不会被公开,必填项已用*标注。

相关推荐