TypeError: the JSON object must be str, not 'bytes'
See original GitHub issueI successfully installed and use jupyterlab-toc:
jupyter labextension list
JupyterLab v0.32.1
Known labextensions:
app dir: /data/srlab/slowikow/src/miniconda2/envs/py3/share/jupyter/lab
jupyterlab-toc
jupyterlab-toc v0.2.1 enabled OK
Today, I decided to try to upgrade to v0.3.1, but I get an error:
jupyter labextension install @jupyterlab/toc
> /data/srlab/slowikow/src/miniconda2/envs/py3/bin/npm pack @jupyterlab/toc
jupyterlab-toc-0.3.1.tgz
Errored, use --debug for full output:
TypeError: the JSON object must be str, not 'bytes'
It seems like an easy bug to fix, but I donโt know which file has the buggy code.
I hope you can help!
Thanks for the great extension ๐
Here are more details:
jupyter labextension install --debug @jupyterlab/toc
jupyter labextension install --debug @jupyterlab/toc Searching ['/PHShome/ks38', '/PHShome/ks38/.jupyter', '/data/srlab/slowikow/src/miniconda2/envs/py3/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files Looking for jupyter_config in /etc/jupyter Looking for jupyter_config in /usr/local/etc/jupyter Looking for jupyter_config in /data/srlab/slowikow/src/miniconda2/envs/py3/etc/jupyter Looking for jupyter_config in /PHShome/ks38/.jupyter Looking for jupyter_config in /PHShome/ks38 > /data/srlab/slowikow/src/miniconda2/envs/py3/bin/npm pack @jupyterlab/toc jupyterlab-toc-0.3.1.tgz โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ โ โ Update available 5.6.0 โ 6.2.0 โ โ Run npm i -g npm to update โ โ โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ Fetching URL: https://registry.npmjs.org/@jupyterlab%2Ftoc Traceback (most recent call last): File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/labextensions.py", line 71, in start ans = self.run_task() File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/labextensions.py", line 100, in run_task for arg in self.extra_args File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/labextensions.py", line 100, in <listcomp> for arg in self.extra_args File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/commands.py", line 227, in install_extension return handler.install_extension(extension) File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/commands.py", line 366, in install_extension info = self._install_extension(extension, tempdir) File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/commands.py", line 1138, in _install_extension version = self._latest_compatible_package_version(name) File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/commands.py", line 1202, in _latest_compatible_package_version metadata = _fetch_package_metadata(self.registry, name, self.logger) File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/site-packages/jupyterlab/commands.py", line 1588, in _fetch_package_metadata return json.load(response) File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/json/__init__.py", line 268, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/data/srlab/slowikow/src/miniconda2/envs/py3/lib/python3.5/json/__init__.py", line 312, in loads s.__class__.__name__)) TypeError: the JSON object must be str, not 'bytes' Errored, use --debug for full output: TypeError: the JSON object must be str, not 'bytes'
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
TypeError: the JSON object must be str, not 'bytes'
I have the following, very basic code that throws; TypeError: the JSON object must be str, not ...
Read more >The JSON object must be str, bytes or bytearray, not list
The Python "TypeError: the JSON object must be str, bytes or bytearray, not list" occurs when we pass a list to the json.loads()...
Read more >Python3: TypeError: the JSON object must be str, not 'bytes' #17
json.load() requires str , but HTTPResponse.read() returns bytes. In Python 3.6 it should work, as json.load() has additional logic toย ...
Read more >PYTHON : TypeError: the JSON object must be str, not 'bytes'
PYTHON : TypeError: the JSON object must be str, not 'bytes ' [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ]ย ...
Read more >"TypeError: the JSON object must be str, not 'bytes'"
Hi! I'm trying to run GYB on my Synology NAS device, which has Python 3 installed. It seems like GYB should work on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just opened jupyterlab/jupyterlab#4962 with this fix. Thanks again @slowkow
Fixed by jupyterlab/jupyterlab#4962