Search code examples
pythonpython-2.7xbrl

ImportError: cannot import name Serializer


I am using python 2.7 and trying to run python-xbrl package. Following exact instructions here, but every time I try import xbrl or from xbrl import XBRLParser, GAAP, GAAPSerializer I get

ImportError                               Traceback (most recent call last)
<ipython-input-2-ccb496289539> in <module>()
----> 1 import xbrl

/usr/local/lib/python2.7/dist-packages/xbrl/__init__.py in <module>()
      6 version = (1, 1, 0)
      7 
----> 8 from .xbrl import XBRLParser, GAAP, GAAPSerializer, XBRLParserException

/usr/local/lib/python2.7/dist-packages/xbrl/xbrl.py in <module>()
      3 
      4 import re
----> 5 from marshmallow import Serializer, fields
      6 import datetime
      7 import collections

ImportError: cannot import name Serializer

So far I have updated all the required packages (pytest, pep8, marshmallow, beautifulsoup4, ordereddict, lxml, six) and updated python-xbrl, but I still get the same error.


Solution

  • I believe this is a known issue, as seen here.

    We just have to install the latest update from github. sudo pip install git+https://github.com/greedo/python-xbrl.git