NiimPrintX icon indicating copy to clipboard operation
NiimPrintX copied to clipboard

Python 3.13.2 (or higher than 3.13) is not working with Poetry install

Open sjanssen15 opened this issue 10 months ago • 1 comments

I'm getting the following error on Windows 11 / Python 3.13.2 when running: poetry install

The currently activated Python version 3.13.2 is not supported by the project (>=3.12,<3.13).
Trying to find and use a compatible version.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command. 

The README.md however says the following:

To run NiimPrintX, you need to have the following installed:
- Python 3.12 or later

Should this text be changed?

sjanssen15 avatar Feb 10 '25 18:02 sjanssen15

I'm trying to get this working with 3.13 as well

I fixed one of the issues but now pillow is complaining about 3.13

Updated: pyproject.toml


[tool.poetry]
name = "NiimPrintX"
version = "0.1.0"
description = "App to print labels using NiimBot printer"
authors = ["Labbots <[email protected]>"]
license = "GNU GPLv3"
readme = "README.md"
packages = [{include = "*", from="NiimPrintX"}]

[tool.poetry.dependencies]
python = ">=3.12,<3.14"
bleak = { version = "^0.21.1", python = ">=3.12,<3.13" }
click = "^8.1.7"
loguru = "^0.7.2"
pillow = "^10.3.0"
pycairo = "^1.26.0"
wand = "^0.6.13"
appdirs = "^1.4.4"
rich = "^13.7.1"

[tool.poetry.group.dev.dependencies]
devtools = "^0.12.2"
pyinstaller = "^6.6.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

geo@Bernkastel ~/NiimPrintX (main) [127]> poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  - Installing pillow (10.3.0): Failed

PEP517 build of a dependency failed

Backend subprocess exited when trying to invoke get_requires_for_build_wheel

    | Command '['/tmp/tmprm1cq_tk/.venv/bin/python', '/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py', 'get_requires_for_build_wheel', '/tmp/tmprl4jbxeq']' returned non-zero exit status 1.
    | 
    | Traceback (most recent call last):
    |   File "/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
    |     main()
    |     ~~~~^^
    |   File "/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
    |     json_out["return_val"] = hook(**hook_input["kwargs"])
    |                              ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
    |     return hook(config_settings)
    |   File "/tmp/tmprm1cq_tk/.venv/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
    |     return self._get_build_requires(config_settings, requirements=[])
    |            ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/tmprm1cq_tk/.venv/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
    |     self.run_setup()
    |     ~~~~~~~~~~~~~~^^
    |   File "/tmp/tmprm1cq_tk/.venv/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
    |     exec(code, locals())
    |     ~~~~^^^^^^^^^^^^^^^^
    |   File "<string>", line 33, in <module>
    |   File "<string>", line 27, in get_version
    | KeyError: '__version__'

Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with pillow (10.3.0)

  - not supporting PEP 517 builds
  - not specifying PEP 517 build requirements correctly
  - the build requirements are incompatible with your operating system or Python version
  - the build requirements are missing system dependencies (eg: compilers, libraries, headers).

WhitleyStriber avatar Apr 07 '25 16:04 WhitleyStriber