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.

2.2.0 conda install fails with JSONDecodeError

See original GitHub issue

In a freshly created py37 environment via conda-forge, I want to add nb_conda_kernels, but the install fails:

$ conda install nb_conda_kernels                                                                  (py37)
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /Users/klay6683/miniconda3/envs/py37

  added / updated specs:
    - nb_conda_kernels


The following NEW packages will be INSTALLED:

  bleach             conda-forge/noarch::bleach-3.1.0-py_0
  nb_conda_kernels   conda-forge/osx-64::nb_conda_kernels-2.2.0-py37_1000


Proceed ([y]/n)?

Preparing transaction: done
Verifying transaction: done
Executing transaction: / + /Users/klay6683/miniconda3/envs/py37/bin/python -m nb_conda_kernels.install --enable
Enabling nb_conda_kernels...
Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nb_conda_kernels/install.py", line 190, in <module>
    exit(install(**parser.parse_args().__dict__))
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nb_conda_kernels/install.py", line 159, in install
    cfg_g = BaseJSONConfigManager(config_dir=path_g).get(JNC)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/traitlets/config/manager.py", line 63, in get
    return json.load(f)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 9 column 5 (char 196)

failed
ERROR conda.core.link:_execute(543): An error occurred while installing package 'conda-forge::nb_conda_kernels-2.2.0-py37_1000'.
LinkError: post-link script failed for package conda-forge::nb_conda_kernels-2.2.0-py37_1000
running your command again with `-v` will provide additional information
location of failed script: /Users/klay6683/miniconda3/envs/py37/bin/.nb_conda_kernels-post-link.sh
==> script messages <==
+ /Users/klay6683/miniconda3/envs/py37/bin/python -m nb_conda_kernels.install --enable
Enabling nb_conda_kernels...
Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nb_conda_kernels/install.py", line 190, in <module>
    exit(install(**parser.parse_args().__dict__))
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nb_conda_kernels/install.py", line 159, in install
    cfg_g = BaseJSONConfigManager(config_dir=path_g).get(JNC)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/traitlets/config/manager.py", line 63, in get
    return json.load(f)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 9 column 5 (char 196)


Attempting to roll back.

Rolling back transaction: done

LinkError: post-link script failed for package conda-forge::nb_conda_kernels-2.2.0-py37_1000
running your command again with `-v` will provide additional information
location of failed script: /Users/klay6683/miniconda3/envs/py37/bin/.nb_conda_kernels-post-link.sh
==> script messages <==
+ /Users/klay6683/miniconda3/envs/py37/bin/python -m nb_conda_kernels.install --enable
Enabling nb_conda_kernels...
Traceback (most recent call last):
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nb_conda_kernels/install.py", line 190, in <module>
    exit(install(**parser.parse_args().__dict__))
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/nb_conda_kernels/install.py", line 159, in install
    cfg_g = BaseJSONConfigManager(config_dir=path_g).get(JNC)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/traitlets/config/manager.py", line 63, in get
    return json.load(f)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/klay6683/miniconda3/envs/py37/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 9 column 5 (char 196)

Some system info: conda info


     active environment : py37
    active env location : /Users/klay6683/miniconda3/envs/py37
            shell level : 1
       user config file : /Users/klay6683/.condarc
 populated config files : /Users/klay6683/.condarc
                          /Users/klay6683/miniconda3/envs/py37/.condarc
          conda version : 4.6.1
    conda-build version : not installed
         python version : 3.7.2.final.0
       base environment : /Users/klay6683/miniconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/klay6683/miniconda3/pkgs
                          /Users/klay6683/.conda/pkgs
       envs directories : /Users/klay6683/miniconda3/envs
                          /Users/klay6683/.conda/envs
               platform : osx-64
             user-agent : conda/4.6.1 requests/2.21.0 CPython/3.7.2 Darwin/18.2.0 OSX/10.14.3
                UID:GID : 273771:2260
             netrc file : None
           offline mode : False


conda config --show-sources

==> /Users/klay6683/.condarc <==
auto_update_conda: True
pinned_packages: []
report_errors: True
anaconda_upload: True

==> /Users/klay6683/miniconda3/envs/py37/.condarc <==
pinned_packages:
  - conda-forge::opencv
  - conda-forge::gdal
  - conda-forge::numpy
channels:
  - conda-forge
  - defaults

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
michaelayecommented, Jan 30, 2019

installing 2.1.1 works fine.

0reactions
mcg1969commented, Jul 7, 2020

I’m going to need some help reproducing this.

conda create -n p37 -c conda-forge python=3.7 notebook
conda install -n p37 -c conda-forge nb_conda_kernels

Produces the following output:

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/mgrant/miniconda3/envs/p37

  added / updated specs:
    - nb_conda_kernels


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    nb_conda_kernels-2.2.3     |           py37_0          32 KB  conda-forge
    ------------------------------------------------------------
                                           Total:          32 KB

The following NEW packages will be INSTALLED:

  nb_conda_kernels   conda-forge/osx-64::nb_conda_kernels-2.2.3-py37_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
nb_conda_kernels-2.2 | 32 KB     | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: \ b'Enabling nb_conda_kernels...\nStatus: enabled\n'
done

What’s different about my installation vs. yours, I wonder?

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSONDecodeError in Python API - Forum
I updated the eikon package after I got the error message. But this did not resolve the problem. The following request. ek.get_timeseries('.
Read more >
Release notes — conda 22.11.1.post16+ce4e810c9 ...
Fix for conda update and conda install issues related to channel notices. ... handle JSONDecodeError better when package is corrupted at extract time...
Read more >
python-redmine - PyPI
Unsupported Redmine resource error while trying to use Python-Redmine without installation (Issue #156). It was impossible to set data, params and headers via ......
Read more >
Trouble updating to Anaconda Navigator 1.10.0 (MacOS)
How I fixed this problem is by the following steps! ... Run the command: conda install anaconda-navigator=2.2.0; Run the command: conda ...
Read more >
collecting package metadata (current_repodata.json): done ...
conda install packages error: Collecting package metadata ... JSONDecodeError: Unterminated string starting at: line 54584 column 7 (char 1704072) .
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