JSONDecodeError
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: macOS Mojave 10.14
- Poetry version: 0.12.9 pyproject.toml file:
λ cat pyproject.toml
[tool.poetry]
name = "pixiv2bg"
version = "1.0.0"
description = "Pixiv pictures to background."
authors = ["Nasy"]
license = "MIT"
[tool.poetry.dependencies]
uvloop = "^0.11.1"
aiohttp = "^3.3"
tqdm = "^4.24"
ujson = "^1.35"
[tool.black]
line-length = 79
Issue
Well, when doing poetry install
, an exception happened. I also have tried to remove the pyproject.toml and poetry init
again, but it still failed like the result shown below.
The project is here: https://github.com/nasyxx/pixiv2bg . Simply clone it down and poetry install
, the exception will raise.
Here is the result:
λ poetry install -vvv
[JSONDecodeError]
Expecting value: line 1 column 1 (char 0)
Exception trace:
/usr/local/lib/python3.7/site-packages/cleo/application.py in run() at line 94
status_code = self.do_run(input_, output_)
/usr/local/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
return super(Application, self).do_run(i, o)
/usr/local/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
status_code = command.run(input_, output_)
/usr/local/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
/usr/local/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 136
self.initialize(input_, output_)
/usr/local/lib/python3.7/site-packages/poetry/console/commands/env_command.py in initialize() at line 21
".".join(str(v) for v in current_env.version_info[:3])
/usr/local/lib/python3.7/site-packages/poetry/utils/env.py in version_info() at line 128
return tuple(self.marker_env["version_info"])
/usr/local/lib/python3.7/site-packages/poetry/utils/env.py in marker_env() at line 144
self._marker_env = self.get_marker_env()
/usr/local/lib/python3.7/site-packages/poetry/utils/env.py in get_marker_env() at line 466
return json.loads(output)
/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py in loads() at line 348
return _default_decoder.decode(s)
/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py in decode() at line 337
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py in raw_decode() at line 355
raise JSONDecodeError("Expecting value", s, err.value) from None
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
json — JSON encoder and decoder — Python 3.11.1 ...
If the data being deserialized is not a valid JSON document, a JSONDecodeError will be raised. Changed in version 3.6: s can now...
Read more >Python JSONDecodeError Explanation and Solution | CK
A Python JSONDecodeError indicates there is an issue with the way in which your JSON data is formatted. For example, your JSON data...
Read more >python - Handle JSON Decode Error when nothing returned
JSONDecodeError actually inherits from ValueError (proof here), I simplified the catch statement by just using ValueError .
Read more >Python JSON tricks: how to deal with JSONDecodeError
Trick 1: You should use double quotes for keys and values, otherwise you will have the JSONDecodeError error: To solve this error, you...
Read more >json.decoder.JSONDecodeError: Extra data in Python
The Python json.decoder.JSONDecodeError: Extra data occurs when we try to parse multiple objects without wrapping them in an array.
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
this occurs with 3.10-rc2 on ubuntu 20.04
for me at least https://github.com/sdispater/poetry/issues/779 seems to be the root cause. EnvBuilder create fails to copy files for some reason and leaves a partially created and nonfunctional venv. How it fails I’m not clear on yet. However at least on my system I have a consistent repro by doing this ( code modeled on utils/env.py )
which gives this error
but it works if I flip the mode to use symlinks
and that also works after patching env.py in poetry.
note - that you only see this error on the first command that triggers venv creation. Subsequent commands will call get_marker_env() that shells out to the python in the broken venv and gets an error string instead of a valid json block - triggering the JSONDecodeError error above.