'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版本,問題解決!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM