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

Cannot install ipykernel 6.29.4 with poetry #9288

Closed
david-waterworth opened this issue Apr 9, 2024 · 6 comments
Closed

Cannot install ipykernel 6.29.4 with poetry #9288

david-waterworth opened this issue Apr 9, 2024 · 6 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@david-waterworth
Copy link

Description

I'm not sure if this is an upstream issue, I have an in-project venv (.venv) and I'm using vscode. I use poetry to maange my dependencies and occasional notebooks for visualization. I prefer to add ipykernel to poetry (vscode will install it automatically but poetry install --sync removes it)

This broke today, after a bit of debugging I discovered that

.venv/bin/python -m pip install ipykernel -U --force-reinstall

Works fine. This install ipykernel==6.29.4, along with dependencies including jupyer_core

My poetry.yaml contains

[tool.poetry.group.dev.dependencies]
ipykernel = "6.29.4"

When I run poetry lock this doesn't add the required dependencies (jupyer_core etc) to poetry.lock so they're not included and I get an import error.

When I revert to

[tool.poetry.group.dev.dependencies]
ipykernel = "6.29.3"

It works, so I guess there's something about 6.29.4 that breaks a poetry install (but pip install works fine).

This was made worse because the version was specified as "^6.29.3" so it suddenly broke with no indication why. I'd imagine this needs to be reported to the maintainers of ipykernel but I have no idea what to include.

Workarounds

Downgrade ipykernel

Poetry Installation Method

pipx

Operating System

Ubuntu 22.04

Poetry Version

Poetry (version 1.7.1)

Poetry Configuration

cache-dir = "/home/david/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/david/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

n/a
@david-waterworth david-waterworth added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 9, 2024
@dimbleby
Copy link
Contributor

dimbleby commented Apr 9, 2024

Duplicate #9191, #9195, #9244, #9266, #9272, with same solution.

Please close.

@david-waterworth
Copy link
Author

Thanks, updating pkginfo alone didn't work (by itself), but clearing my cache did. It also wasn't 100% clear from the linked issues how to properly update pkginfo in a pipx installation of poetry (I ran poetry self add pkginfo==1.10.0 as recommended but then another poster later said "this isn't correct for pipx installs" but didn't elaborate why.

Also is this likely to reoccur? I don't see any permanent fix in any of the linked issues. Having a build server suddenly fail and require manual intervention is a bit of a pain.

@dimbleby
Copy link
Contributor

dimbleby commented Apr 9, 2024

is this likely to reoccur?

Are you likely to downgrade pkginfo?
#9130

@david-waterworth
Copy link
Author

No, it wasn't clear what the actual issue was - but if I'm not mistaken it's packages that use the newer "metadata version 2.3 / PEP 685" which requires pkginfo >= 1.10.0 for poetry (but not pip?).

Ideally though there would be be some sort of warning at least if poetry encounters package metadata that it doesn't support rather than silently not installing (or in my case uninstalling) dependencies - if that's possible? Otherwise it could happen again when "metadata version 2.4" comes out some time in the distant future?

@dimbleby
Copy link
Contributor

#9195

Please close

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 May 11, 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

2 participants