【问题标题】:Cannot import jsonstreamer / cannot pip install yajl-py无法导入 jsonstreamer / 无法 pip install yajl-py
【发布时间】:2015-08-19 22:36:01
【问题描述】:

我正在尝试使用 JSON 流媒体来解析一个 11gb 的大型 JSON 文件。 JSONstreamer 似乎是唯一一个无需先将整个文件加载到内存即可流式传输文件的包。

当我尝试在 python 中导入 jsonstreamer 时出现此错误。

OSError: Yajl cannot be found.

当我尝试 pip install yajl 我得到这个错误:

File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

但是所有的文件都在那里

我从他们的网页下载了 yajl.dll 文件并将其添加到我的 C:\Windows\SysWOW64 目录中。

真的不知道如何继续,因为我好像被卡住了。

【问题讨论】:

  • 你好,你找到解决这个问题的方法了吗?我遇到了和你一样的问题。
  • 我认为问题在于这个包有问题。我建议使用可以将文件作为流处理的包。

标签: python json yajl


【解决方案1】:

我遇到了同样的问题,在机器上安装 git 是固定的:在 pip3 脚本中有一个依赖项。

关键在日志上,你可以看到一个git子进程是如何执行的:

Running setup.py (path:/tmp/pip-build-01hs0gev/yajl/setup.py) egg_info for package yajl
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "/tmp/pip-build-01hs0gev/yajl/setup.py", line 64, in <module>
    subprocess.call(['git', 'submodule', 'update',])
  File "/usr/lib/python3.4/subprocess.py", line 537, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git'

【讨论】:

    猜你喜欢
    • 2016-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-12
    • 2020-09-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多