cannot import name '_jsonl' from partially initialized module 'jsonl'

114 Views Asked by At

I am trying to install the python jsonl module on an Ubuntu system. Tried on two different computers and get the same exact error:

pip install jsonl

Collecting jsonl
  Downloading jsonl-1.6.tar.gz (9.0 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5lw5f9ew/jsonl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5lw5f9ew/jsonl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-5lw5f9ew/jsonl/pip-egg-info         cwd: /tmp/pip-install-5lw5f9ew/jsonl/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-5lw5f9ew/jsonl/setup.py", line 5, in <module>
        import jsonl
      File "/tmp/pip-install-5lw5f9ew/jsonl/jsonl/__init__.py", line 19, in <module>
        from jsonl import _jsonl as jsonl
    ImportError: cannot import name '_jsonl' from partially initialized module 'jsonl' (most likely due to a circular import) (/tmp/pip-install-5lw5f9ew/jsonl/jsonl/__init__.py)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Any ides on how to fix this? As the same exact error occurs on two systems, I'm thinking it's a config error on my part, but no idea on how to resolve. Thanks!

1

There are 1 best solutions below

1
phd On

jsonl, the latest version 1.6 was released in 2014. I can install it with Python 2.7 but not with Python 3. The bottom line: it's an outdated abandoned project, forget it.

Another problem: it requires simplejson but doesn't declare it as a dependency.