Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry install exits after summarizing the execution plan #7148

Closed
4 tasks done
FranzForstmayr opened this issue Dec 6, 2022 · 35 comments
Closed
4 tasks done

poetry install exits after summarizing the execution plan #7148

FranzForstmayr opened this issue Dec 6, 2022 · 35 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@FranzForstmayr
Copy link

  • Poetry version: 1.2.2
  • Python version: 3.9.15
  • OS version and name: Ubuntu 20.04.5 LTS
  • pyproject.toml:
[tool.poetry]
name = "test_app"
version = "1.1.0"
description = "Test Application"
authors = [
    "Name Surname <name@mail.com>",
]
license = "proprietary"

[tool.poetry.dependencies]
python = "~3.9"
openpyxl = "^3.0.9"
pandas = "^1.4.1"
dash-extensions = "^0.1.6"
scipy = "^1.9.3"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"
flake8-bugbear = "^22.1.11"
flake8-docstrings = "^1.6.0"
pep8-naming = "^0.12.1"
flake8-formatter-junit-xml = "^0.0.6"
pytest = "^7.1.0"
nox = "^2022.1.7"
flake8-annotations = "^2.7.0"
Sphinx = "^4.4.0"
sphinx-rtd-theme = "^1.0.0"
sphinx-autodoc-typehints = "^1.17.0"
black = "^22.1.0"
pytest-cov = "^3.0.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

When I try to install this project on this certain machine, nothing happens.
Verbose option does not show anything useful. Is there another way to debug this issue?

(test-app-py3.9) host@HOST:~/apps/test-app$ poetry install -vvv
Loading configuration file /home/host/.config/pypoetry/config.toml
Loading configuration file /home/host/.config/pypoetry/auth.toml
Using virtualenv: /home/host/apps/test-app/.venv
Project environment contains an empty path in sys_path, ignoring.
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 81 installs, 0 updates, 0 removals
@FranzForstmayr FranzForstmayr added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 6, 2022
@n8sty
Copy link
Contributor

n8sty commented Dec 6, 2022

If you run ls /home/host/apps/test-app/.venv do you see the expected packages in the output? What about if you run poetry run pip freeze? Is there anything following the line beginning Package operations:... in the output?

@FranzForstmayr
Copy link
Author

I activated the env manually, none of the specified packages was installed, only the default ones:

Package    Version
---------- -------
pip        22.3
setuptools 65.5.0
wheel      0.37.1

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip install --upgrade pip

No, there's nothing below package operations, I posted the full output.
It's strange, because I can trigger this only on this machine for now, however I don't know how to debug.

@FranzForstmayr
Copy link
Author

Reinstalling poetry did not solve the issue.

@clementdavies56

This comment was marked as off-topic.

@Davidnet

This comment was marked as off-topic.

@sjperkins

This comment was marked as off-topic.

@sjperkins

This comment was marked as off-topic.

@FranzForstmayr
Copy link
Author

The last output on my machine is Package Operations, so probably this is something different.

@sjperkins

This comment was marked as off-topic.

@FranzForstmayr
Copy link
Author

Clearing cache does not work.

host@Host:~/apps/test-app$ poetry cache list
PyPI
_default_cache
gitlab
pypi
host@Host:~/apps/test-app$ poetry cache clear _default_cache --all
Delete 0 entries? (yes/no) [yes]
host@Host:~/apps/test-app$ poetry cache clear PyPI --all
Delete 0 entries? (yes/no) [yes]
host@Host:~/apps/test-app$ poetry cache clear gitlab --all
Delete 0 entries? (yes/no) [yes]
host@Host:~/apps/test-app$ poetry cache clear pypi --all
Delete 0 entries? (yes/no) [yes]
host@Host:~/apps/test-app$ poetry install
Loading configuration file /home/host/.config/pypoetry/config.toml
Loading configuration file /home/host/.config/pypoetry/auth.toml
Using virtualenv: /home/host/apps/test-app/.venv
Project environment contains an empty path in sys_path, ignoring.
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 100 installs, 0 updates, 0 removals

@clintonroy

This comment was marked as off-topic.

@clementdavies56

This comment was marked as off-topic.

@Davidnet

This comment was marked as off-topic.

@georgeseifada

This comment was marked as off-topic.

@travellingprog

This comment was marked as off-topic.

@FranzForstmayr
Copy link
Author

does not help in this case.

@neersighted
Copy link
Member

I'd like to clarify that this issue is very specific and relates to no output/Poetry silently exiting after planning its install operation. The other comments here are off-topic and relate to different issues entirely, many of which are solved in 1.3.1.

@FranzForstmayr, can you please test on 1.3.1. Additionally, can you please provide the output of stty size? I suspect this may be a duplicate of #7184, or at the very least the same code is swallowing an exception.

@FranzForstmayr
Copy link
Author

stty size returns "58 209"

I upgraded to 1.3.1 in the meantime, but still same issue. But it seems not affected from project files (pyproject.toml, poetry.lock)..

@neersighted neersighted changed the title Poetry install does nothing poetry install exits after summarizing the execution plan Dec 21, 2022
@neersighted
Copy link
Member

Can you also provide the exit code? poetry install; echo $? should be sufficient.

@FranzForstmayr
Copy link
Author

1

@neersighted
Copy link
Member

neersighted commented Dec 22, 2022

Okay, looks like another specialized variant of #7184; the root cause is different but the effect (swallowing an exception) is the same. Can you run Poetry with -vvv --no-ansi and see what output you get?

@jaoxford
Copy link

jaoxford commented Jan 5, 2023

Same thing happens for us, when running poetry install -vvv; echo $? from CodeFresh. We get the following:

Loading configuration file /codefresh/volume/yo-main-application/poetry.toml
Using virtualenv: /root/.venv
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 211 installs, 0 updates, 0 removals

1

1 being the exit code.

@neersighted
Copy link
Member

Can you run Poetry with -vvv --no-ansi and see what output you get?

@jaoxford
Copy link

jaoxford commented Jan 5, 2023

Can you run Poetry with -vvv --no-ansi and see what output you get?

I followed the recommendations in here: #7184 to use --no-ansi and it solved our issue.

@FranzForstmayr
Copy link
Author

Finally more output:

Loading configuration file /home/host/.config/pypoetry/config.toml
Loading configuration file /home/host/.config/pypoetry/auth.toml
Using virtualenv: /home/rd-app-host/apps/test-app/.venv
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 41 installs, 0 updates, 0 removals, 62 skipped


  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:251 in _execute_operation
      249|                 if self._should_write_operation(operation):
      250|                     if not operation.skipped:
    > 251|                         self._io.write_line(

sorry for the delay, was not in the office for a few days.

@onnodb
Copy link

onnodb commented Jan 20, 2023

Encountering the same issue. Perhaps the following information helps in troubleshooting?

Poetry version: 1.3.2
Python version: 3.10.6
OS: Xubuntu 22.04.1 LTS

Poetry was installed with the official installer on a plain-vanilla Xubuntu installation (in a VM).

poetry -vvv install runs all the way until the output:

Writing lock file

Finding the necessary packages for the current system:
Source (poetry-repo): 1 packages found for mypy >= ...
(list of other packages)

and then exits with exit code 1. No actual installation of any packages is performed, and the environment remains empty (as checked with pip list inside the env).

The lack of any error messages or feedback is rather baffling.

Running poetry -vvv --no-ansi install instead gives the same unhandled exception and stack trace as reported above by FranzForstmayr.

Same issue occurs both with the config setting virtualenvs.in-project set to true, as well as its default false. stty size returns 55 271 (running in the default xfce4-terminal).

Workaround

Export dependencies to a requirements.txt file, and install with pip:

$ poetry export -f requirements.txt --output requirements.txt
$ # activate virtualenv
$ pip install -r requirements.txt

@FranzForstmayr
Copy link
Author

@neersighted

I finally upgraded to 1.3.2 but still had the same issue.
While digging around a little bit, I finally found a workaround.

I removed the bullet characters in https://github.com/python-poetry/poetry/blob/master/src/poetry/installation/executor.py#L245 and the following lines and poetry works again on this machine.

@FranzForstmayr
Copy link
Author

as it seems to be terminal related, maybe this information also helps.

This is a virtual ubuntu machine without graphical interface. I usually connect from a windows computer with powershell,the new windows terminal application or VS Code remote terminal.

@jcrawfordor
Copy link

Experiencing the same problem with Poetry 1.4.2 on Debian 11.6 with Python 3.9.

Output of "poetry install -vvv --no-ansi":

Loading configuration file /root/.config/pypoetry/config.toml
Using virtualenv: <snip>
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 25 installs, 0 updates, 0 removals


  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:268 in _execute_operation
      266|                 if self._should_write_operation(operation):
      267|                     if not operation.skipped:
    > 268|                         self._io.write_line(

  Stack trace:

  4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:268 in _execute_operation
      266|                 if self._should_write_operation(operation):
      267|                     if not operation.skipped:
    > 268|                         self._io.write_line(

Without --no-ansi there is no output after printing the plan summary. This is occurring when accessing the machine via SSH with or without tmux.

@sadahry
Copy link

sadahry commented Sep 6, 2023

--no-ansi option works for me on circleci job.

@JDJGInc
Copy link

JDJGInc commented Oct 17, 2023

I got this issue on this machine:

neofetch                                                                                                                                                                                         [14:14:36]
       _,met$$$$$gg.          jdjg@raspberrypi 
    ,g$$$$$$$$$$$$$$$P.       ---------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 11 (bullseye) aarch64 
 ,$$P'              `$$$.     Host: Raspberry Pi 4 Model B Rev 1.1 
',$$P       ,ggs.     `$$b:   Kernel: 6.1.31-v8+ 
`d$$'     ,$P"'   .    $$$    Uptime: 32 days, 5 hours, 3 mins 
 $$P      d$'     ,    $$P    Packages: 1491 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: zsh 5.8 
 $$;      Y$b._   _,d$P'      Resolution: 1920x1080 
 Y$$.    `.`"Y$$$$P"'         DE: LXDE 
 `$$b      "-.__              Theme: PiXflat [GTK3] 
  `Y$$                        Icons: PiXflat [GTK3] 
   `Y$$.                      Terminal: lxterminal 
     `$$b.                    Terminal Font: Monospace 10 
       `Y$$b.                 CPU: BCM2835 (4) @ 1.500GHz 
          `"Y$b._             Memory: 519MiB / 1849MiB 
              `"""
                                                      
                                                      

@JDJGInc
Copy link

JDJGInc commented Oct 17, 2023

@JDJGInc
Copy link

JDJGInc commented Oct 17, 2023

Grabbed with poetry install -vvv > food.txt

@dimbleby
Copy link
Contributor

should have been fixed by cleo 2.1, python-poetry/cleo#299

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests