导入ijson模块python时出错 [英] error when importing ijson module python

查看:376
本文介绍了导入ijson模块python时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一些大(2 Gb +)文件解析为python.我已经用json模块尝试过了,但是由于它的方法都一次加载了文件,所以出现了内存错误. 然后,我继续安装ijson,据说该方法实现了基于迭代器的文件解析方式.但是,当我运行时:

I need to parse some large (2 Gb+) files into python. I have tried it with the json module but I get a memory error as its methods all load the files at once. I then moved on into installing ijson which suposedly implements a iterator-based way of parsing the file. However when I run:

导入ijson

我遇到异常:找不到YAJL共享对象.

I get exception : YAJL shared object not found.

有人发现类似问题吗? 任何帮助将不胜感激

Has anyone found a similar issue? any help would be greatly appreciated

致谢

推荐答案

那很简单,这是因为您尚未安装YAJL C库! ijson是围绕YAJL的包装,如果没有,它将无法正常工作.

Thats an easy one, that is because you haven't installed the YAJL C library! ijson is a wrapper around the YAJL without it won't work.

这篇关于导入ijson模块python时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆