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.

virtualenvs.create false and .venv poetry install not working

See original GitHub issue
  • I am on the [latest](https://github.com/sdispater/poetry/rpoetry config settings.virtualenvs.in-project trueeleases/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).

  • Debian9-Strech:

  • 0.12.10:

  • Brand new pyproject after poetry new

Issue

Hello, I develop a new project with poetry, the option : settings.virtualenvs.in-project true is activated Then I COPY the folder in a docker to build it, I use then the option : virtualenvs.create false poetry install -vvv wont build it with this error :

[JSONDecodeError]             
Expecting value: line 1 column 1 (char 0)  
                                             
Exception trace:
 /root/.poetry/lib/poetry/_vendor/py3.5/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /root/.poetry/lib/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /root/.poetry/lib/poetry/_vendor/py3.5/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /root/.poetry/lib/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /root/.poetry/lib/poetry/_vendor/py3.5/cleo/commands/base_command.py in run() at line 136
   self.initialize(input_, output_)
 /root/.poetry/lib/poetry/console/commands/env_command.py in initialize() at line 21
   ".".join(str(v) for v in current_env.version_info[:3])
 /root/.poetry/lib/poetry/utils/env.py in version_info() at line 128
   return tuple(self.marker_env["version_info"])
 /root/.poetry/lib/poetry/utils/env.py in marker_env() at line 144
   self._marker_env = self.get_marker_env()
 /root/.poetry/lib/poetry/utils/env.py in get_marker_env() at line 457
   return json.loads(output)
 /usr/lib/python3.5/json/__init__.py in loads() at line 319
   return _default_decoder.decode(s)
 /usr/lib/python3.5/json/decoder.py in decode() at line 339
   obj, end = self.raw_decode(s, idx=_w(s, 0).end())
 /usr/lib/python3.5/json/decoder.py in raw_decode() at line 357
   raise JSONDecodeError("Expecting value", s, err.value) from None

install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]

If I remove the .venv it works again.

Thanks for your project. It’s very helpful 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chdsbdcommented, Jan 18, 2019

I ran into this issue too, but I was running with settings.virtualenvs.in-project = false.

The fix is the same, but I needed to delete the virtual environment in settings.virtualenvs.path

0reactions
abncommented, Oct 7, 2020

@chdsbd I do not think mounting host virtual environments into a container environment is a reliable scenario.

I would recommend you cache the virtual environment in the container instead.

Add this to your .dockerignore file (assuming you use in-project on your host).

.venv
dist/
FROM python:3.8

RUN pip install poetry
RUN poetry config virtualenvs.-
RUN install -d /opt/src

WORKDIR /opt/src

COPY poetry.lock pyproject.toml /opt/src

RUN poetry install  --no-dev --no-root

COPY . /opt/src

RUN poetry install

ENTRYPOINT ["poetry", "run"]

CMD "bash"
Read more comments on GitHub >

github_iconTop Results From Across the Web

virtualenvs.create false and .venv poetry install not working #696
I am on the [latest](https://github.com/sdispater/poetry/rpoetry config settings.virtualenvs.in-project trueeleases/latest) Poetry version.
Read more >
poetry install doesnt create .env folder inside project folder ...
To create an in-project venv for python3.9 using conda you can do this: set the config to virtualenvs.in-project true; without being in a...
Read more >
Configuration | Documentation | Poetry - Python dependency ...
If set to false , Poetry will not create a new virtual environment. If it detects a virtual environment in {cache-dir}/virtualenvs or {project-dir}/.venv...
Read more >
poetry config virtualenvs.create false - You.com | The AI ...
I'm trying to use Poetry within a Docker container that's using ubuntu:focal as the base image. In the container, I can install poetry...
Read more >
Poetry Advance - Python Biella Group
Poetry Advance. Poetry is the most sofisticated Python dependency system available (up to 2020). It allows you to go beyond simple dependency management, ......
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