'OrderedDict' object has no attribute 'register'

  今天在做django rest framework项目的时候,出现如下问题:

  

md.preprocessors.register(CodeBlockPreprocessor(), 'highlight', 40)
AttributeError: 'OrderedDict' object has no attribute 'register'

  各种百度未果,直到看到这篇博客:https://blog.csdn.net/weixin_30907523/article/details/102111700

  恍然大悟,原来是markdown版本不兼容的问题,解决方法如下:

  

# 先安装到最新版本再说
pip uninstall markdown pip install markdown

然后顺利从2.6.11版本更新到3.2.1版本,问题解决!

猜你喜欢

转载自www.cnblogs.com/bk770466199/p/12678254.html