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

ResolutionImpossible error for Numpy #2339

Closed
sr-murthy opened this issue Oct 27, 2023 · 3 comments
Closed

ResolutionImpossible error for Numpy #2339

sr-murthy opened this issue Oct 27, 2023 · 3 comments
Labels
🐛 bug Something isn't working

Comments

@sr-murthy
Copy link
Sponsor Contributor

  • [Y ] I have searched the issue tracker and believe that this is not a duplicate.

Steps to reproduce

The PDM command, which is run in a Py 3.10.1 Docker container, is to install all project dependencies (all project source files, including pyproject.toml, are present in the container working directory, except the lock file which PDM creates from scratch):

pdm install --verbose --project . --dev --no-editable --no-self --no-isolation

The default deps (in pyproject.toml) include Numpy (unpinned).

Actual behavior

This used to work fine until yesterday, today I'm not sure what's wrong. I keep geting the following error:

#16 138.3 resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=PythonRequirement(name='python', marker=None, extras=None, specifier=<PySpecSet >=3.10.1>, editable=False, prerelease=False), parent=None), RequirementInformation(requirement=PythonRequirement(name='python', marker=None, extras=None, specifier=<PySpecSet >=3.9,<3.13>, editable=False, prerelease=False), parent=<Candidate numpy@1.26.1>)]

I've tried restricting Numpy to earlier versions, and using even using later versions of Python for the Docker image. Same result.

Expected behavior

Successful installation of all project deps.

Environment Information

This is a Docker environment:

#16 0.865 python.use_venv is on, creating a virtualenv for this project...
#16 2.278 Virtualenv is created successfully at /<project name>/.venv
#16 2.328 PDM version:
#16 2.328   2.10.0
#16 2.328 Python Interpreter:
#16 2.328   /<project name>/.venv/bin/python (3.10)
#16 2.328 Project Root:
#16 2.328   /<project name>
#16 2.329 Local Packages:
#16 2.329   
#16 3.212 {
#16 3.212   "implementation_name": "cpython",
#16 3.212   "implementation_version": "3.10.13",
#16 3.212   "os_name": "posix",
#16 3.212   "platform_machine": "x86_64",
#16 3.212   "platform_release": "5.4.0-162-generic",
#16 3.212   "platform_system": "Linux",
#16 3.212   "platform_version": "#179-Ubuntu SMP Mon Aug 14 08:51:31 UTC 2023",
#16 3.212   "python_full_version": "3.10.13",
#16 3.212   "platform_python_implementation": "CPython",
#16 3.212   "python_version": "3.10",
#16 3.212   "sys_platform": "linux"
#16 3.212 }

I've tried to run the same job number of times - it fails with the same error.

@sr-murthy sr-murthy added the 🐛 bug Something isn't working label Oct 27, 2023
@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Oct 27, 2023

It's because the latest Numpy version added <3.13 to its requires-python metadata, so your accepted range is no longer a subset of what your dependencies support. You have to add the same upper bound to your metadata.

@sr-murthy
Copy link
Sponsor Contributor Author

@pawamoy Many thanks. My requires-python was just >=3.9.6, but I've amended this in my TOML. The install works now.

A more general point: I guess this kind of thing can happen very easily, although I haven't come across a case where a dep specifies an upper bound on a Python beta version.

@sr-murthy
Copy link
Sponsor Contributor Author

I should have read the docs first 😊

https://pdm.fming.dev/latest/usage/project/#set-requires-python-value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants