我是python的新手,运行django migration时出现此错误:
from xml.sax.expatreader import ExpatParser as _ExpatParser
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 24, in <module>
raise SAXReaderNotAvailable("expat not supported", None)
xml.sax._exceptions.SAXReaderNotAvailable: expat not supported
在Ubuntu 14.04和python 2.7上使用Django 1.7。有人知道如何解决这个问题吗?
最佳答案
看来您的Python安装已损坏,请参见https://askubuntu.com/questions/161876/puimporterror-no-module-named-pyexpat和/usr/lib/python2.7/xml/sax/expatreader.py。引发的语句是第22行:“从xml.parsers import expat”,而xml.parsers.expat
只是从C pyexpat模块的/usr/lib/python2.7/lib-dynload/pyexpat.so导入所有内容。
关于python - Django外派问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26802182/