question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NameError: name 'ujson' is not defined

See original GitHub issue

I listed the files from S3 urls = ['s3://' + f for f in fs.glob("s3://noaa-goes16/ABI-L2-ACMC/2022/116/*/*.nc")] given around len(urls) 272 files and then generated the jsons files and created in the ./jsons/ directory, however, I run into an issue with gen_json() function NameError: name 'ujson' is not defined. I followed @lsterzinger tutorial in
(https://medium.com/pangeo/fake-it-until-you-make-it-reading-goes-netcdf4-data-on-aws-s3-as-zarr-for-rapid-data-access-61e33f8fe685)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
keewiscommented, Jun 6, 2022

there’s still a typo:

m_list = []
for js in tqdm(json_list):
    with open(js) as f:
        m_list.append(fsspec.get_mapper("reference://", 
            fo=json.load(f), remote_protocol="s3",
            remote_options={"anon": True}))

json.loadujson.load

1reaction
lsterzingercommented, Jun 6, 2022

Thanks for catching this typo @najiya-12 - I corrected the import to import ujson at the beginning of the tutorial. As @martindurant said, it should be installed alongside Kerchunk since it’s listed in the dependencies

Read more comments on GitHub >

github_iconTop Results From Across the Web

python No module named ujson, while it's already installed
I've installed ujson using command pip install ujson and when I've tried to run my python project it returns ImportError: No module named...
Read more >
NameError: global name 'ujson' is not defined · Issue #32
in https://github.com/explosion/sense2vec/blob/master/bin/merge_text.py you import ujson as json: try: import ujson as json except ...
Read more >
ModuleNotFoundError: No module named 'ujson'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'ujson' How to remove the ModuleNotFou.
Read more >
ujson - PyPI
UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Install with pip: python -m...
Read more >
Developers - NameError: global name 'ujson' is not defined -
NameError : global name 'ujson' is not defined. ... try: import ujson as json except ImportError: import json. but then call ujson as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found