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.

  • 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:closed
  • Created 5 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
laoshawcommented, Oct 4, 2021

this occurs with 3.10-rc2 on ubuntu 20.04

4reactions
Imaclean74commented, Apr 29, 2019

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 )

tmpdir = tempfile.mkdtemp()
path = pathlib.Path( tmpdir ) / "test"
print(f"creating temp dir in {path}")
builder = EnvBuilder(with_pip=True)
builder.create(path)

which gives this error

 output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/tmp/tmp2lefjc9x/testp/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' died with <Signals.SIGABRT: 6>.

but it works if I flip the mode to use symlinks

builder = EnvBuilder(with_pip=True, symlinks=True)

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.

Read more comments on GitHub >

github_iconTop 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 >

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