python - 导入错误: cannot import name Serializer

标签 python python-2.7 xbrl

我正在使用 python 2.7 并尝试运行 python-xbrl 包。按照确切的说明 here ,但每次我尝试 import xbrlfrom xbrl import XBRLParser, GAAP, GAAPSerializer 我得到

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

到目前为止,我已经更新了所有必需的软件包(pytest、pep8、marshmallow、beautifulsoup4、ordereddict、lxml、6)并更新了 python-xbrl,但我仍然得到同样的错误。

最佳答案

这是棉花糖版本的问题。尝试-

pip uninstall marshmallow
pip install marshmallow==1.2.6

关于python - 导入错误: cannot import name Serializer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33875919/

相关文章:

python - 使用 memcache.gets() 时出现 AttributeError

python - 为什么在 '__main__'导入模块不允许multiprocessig使用模块?

python-2.7 - 无法在 Windows 7 中为 Python 2.7 安装 tensorflow

python - 每次在 python 中运行脚本时都需要生成一个新的文本文件并保存它

json - 区分 XBRL、XML、CSV 和 JSON

python - 如何分割大型 XBRL 文件?

python-2.7 - 如何开始在 Python 中分析 XBRL?

python - 有没有办法接受 '%' 作为输入的一部分,在 python 2.6 和 3.0 中都有效?

python - 从数据库中断中恢复 Celery

python - 本地到服务器的 pipelinev 不一致