-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 init Unable to Find Package During Interactive Dependency Addition #9884
Comments
I have verified the connectivity to The response confirms that the endpoint is accessible, as shown below:
This may indicate that the issue is not related to network connectivity or access to the PyPI repository. Instead, it seems specific to how poetry init handles package search queries. |
indeed the search returns no results
perhaps something has changed or broken at https://github.com/pypi/warehouse, I expect you'll want to ask over there |
PyPI removed info about the latest version from their search results, breaking our search logic. |
I'm surprised this was ever supported. Pip has been unable to search for years at this point
Probably the best solution is to just use the index directly e.g. https://pypi.org/simple/pytest/. I doesn't let the user do any kind of fuzzy matching, but it at least lets us interactively define dependencies when we're sure we know the package name exactly. |
I'm guessing the culprit is this? |
I have the same issue on Mac M1 MacOs 14.6.1. Poetry 2.0.0
|
@abn could you check if your recent changes to search fix this? |
I don't think my recent change would fix this. We no longer can support search queries against PyPI at the moment as far as I can tell. I have documented it at https://python-poetry.org/docs/main/cli/#search
Although the simple query issue is separate. |
If not results are found when searching PyPI fallback to using the find package mechanism to at the minimum list any matches for valid PEP 508 specifications. Resolves: python-poetry#9884
Can you please try the fix at #10055? While it does not solve partial match searches (we cannot do much about that one), it allows for exact matches with or without constraints. Using pipxpipx install --suffix=@10055 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/10055/head' Using a container (podman | docker)podman run --rm -i --entrypoint bash python:latest <<EOF
set -xe
python -m pip install --disable-pip-version-check --root-user-action ignore -q git+https://github.com/python-poetry/poetry.git@refs/pull/10055/head
poetry new foobar
pushd foobar
poetry search pycowsay 'pytest>=8'
EOF + poetry search pycowsay 'pytest>=8'
Package Version Source Description
pycowsay 0.0.0.1 PyPI
pycowsay 0.0.0.2 PyPI
pytest 8.0.0 PyPI
pytest 8.0.1 PyPI
pytest 8.0.2 PyPI
pytest 8.1.1 PyPI
pytest 8.1.2 PyPI
pytest 8.2.0 PyPI
pytest 8.2.1 PyPI
pytest 8.2.2 PyPI
pytest 8.3.0 PyPI
pytest 8.3.1 PyPI
pytest 8.3.2 PyPI
pytest 8.3.3 PyPI
pytest 8.3.4 PyPI |
If not results are found when searching PyPI fallback to using the find package mechanism to at the minimum list any matches for valid PEP 508 specifications. Resolves: python-poetry#9884
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. |
Description
When using the
poetry init
command to create a new project, the interactive dependency addition step fails to find packages (e.g.,numpy
). However, the poetry add command works as expected for the same package. The issue appears to be related to howpoetry init
handles package search and HTTP requests.Workarounds
After completing the poetry init process, dependencies can be added using the poetry add command. For example:
poetry add numpy
. This bypasses the issue with the interactive dependency search step.Poetry Installation Method
install.python-poetry.org
Operating System
Windows 11 24H2
Poetry Version
1.8.4
Poetry Configuration
Python Sysconfig
Example pyproject.toml
Poetry Runtime Logs
The text was updated successfully, but these errors were encountered: