graphrag
graphrag copied to clipboard
[Issue]: Error with maturin when installing
Do you need to file an issue?
- [x] I have searched the existing issues and this bug is not already filed.
- [x] My model is hosted on OpenAI or Azure. If not, please look at the "model providers" issue and don't file a new one here.
- [x] I believe this is a legitimate bug, not just a question. If this is a question, please use the Discussions area.
Describe the issue
When installing on a Ubuntu container, I have the following error:
maturin failed
Caused by: `project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list
Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-ud5vfdfg', '--interpreter', '/usr/local/bin/python3.12']' returned non-zero exit status 1.
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-ud5vfdfg --interpreter /usr/local/bin/python3.12`
[end of output]
I don't know how to solve this..
the docker image is python:3.12.8-bookworm with rust installed.
any Idea ??
Steps to reproduce
No response
GraphRAG Config Used
# Paste your config here
Logs and screenshots
No response
Additional Information
- GraphRAG Version:
- Operating System:
- Python Version:
- Related Issues:
Thank you for raising. I have the same issue with ubuntu container. The problem seems to stem from graspologic dependency, or more specifically graspologic-native. I tried building manually with maturin too but without success:
maturin build --release
warning: `/app/graspologic-native-main/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
Updating crates.io index
Locking 75 packages to latest compatible versions
Adding clap v2.34.0 (available: v4.5.23)
Adding indoc-impl v0.3.6 (available: v0.3.7)
Adding pyo3 v0.15.2 (available: v0.23.3)
Downloaded byteorder v1.5.0
Downloaded quote v1.0.38
Downloaded atty v0.2.14
Downloaded strsim v0.8.0
Downloaded proc-macro2 v1.0.92
Downloaded unicode-ident v1.0.14
Downloaded getrandom v0.2.15
Downloaded ppv-lite86 v0.2.20
Downloaded instant v0.1.13
Downloaded zerocopy-derive v0.7.35
Downloaded once_cell v1.20.2
Downloaded hermit-abi v0.1.19
Downloaded vec_map v0.8.2
Downloaded clap v2.34.0
Downloaded libc v0.2.169
Downloaded smallvec v1.13.2
Downloaded textwrap v0.11.0
Downloaded lock_api v0.4.12
Downloaded autocfg v1.4.0
Downloaded ansi_term v0.12.1
Downloaded syn v2.0.91
Downloaded zerocopy v0.7.35
Downloaded unicode-width v0.1.14
Downloaded 23 crates (2.1 MB) in 1.07s
💥 maturin failed
Caused by: `project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list
Hi,
I got the exact same error when following the tutorial. After several hours of googling and several attempts, I passed the issue. The short answer is that the error is related to the current Python build system version and some incompatibility in some dependencies. I downgraded to Python version 3.9.12, and it is good to go now.
Here is the detailed answer: https://stackoverflow.com/questions/62983756/what-is-pyproject-toml-file-for
fyi @Bennoo, @APavlides
This is due to changes in maturin 1.8.0, which now require project.dynamic = ["version"] to be specified in pyproject.yaml. The related changes are in PyO3/maturin#2391.
Hello, when I try to downgrade to python 3.9.12. I have the following error:
ERROR: Ignored the following versions that require a different python version: 0.1.1 Requires-Python <3.13,>=3.10; 0.2.0 Requires-Python <3.13,>=3.10; 0.2.1 Requires-Python <3.13,>=3.10; 0.2.2 Requires-Python <3.13,>=3.10; 0.3.0 Requires-Python <3.13,>=3.10; 0.3.1 Requires-Python <3.13,>=3.10; 0.3.2 Requires-Python <3.13,>=3.10; 0.3.3 Requires-Python <3.13,>=3.10; 0.3.4 Requires-Python <3.13,>=3.10; 0.3.5 Requires-Python <3.13,>=3.10; 0.3.6 Requires-Python <3.13,>=3.10; 0.4.0 Requires-Python <3.13,>=3.10; 0.4.1 Requires-Python <3.13,>=3.10; 0.5.0 Requires-Python <3.13,>=3.10; 0.9.0 Requires-Python <3.13,>=3.10; 1.0.0 Requires-Python <3.13,>=3.10; 1.0.1 Requires-Python <3.13,>=3.10 ERROR: Could not find a version that satisfies the requirement graphrag (from versions: none)
It seems graphrag need python >= 3.10 😱
I also tried to downgrade maturin to 1.7.7 (before the specified change) but I still have the same issue when installing graphrag:
Downloaded winapi-x86_64-pc-windows-gnu v0.4.0 💥 maturin failed Caused by: project.versionfield is required in pyproject.toml unless it is present in theproject.dynamiclist Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-wz054tu7', '--interpreter', '/usr/local/bin/python3.12']' returned non-zero exit status 1. Checking for Rust toolchain.... Runningmaturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-wz054tu7 --interpreter /usr/local/bin/python3.12 [end of output]
I should try with some previous version of maturin?
Hi,
According to @katlyn's comment, the issue has been fixed and merged into the main branch of maturin. Could you check using the latest version of maturin?
Not working (maturin version 1.8.0).. Should I add this version somewhere? I don't exactly get the point here.. The related toml file is the one for GraphRag?
According to @katlyn's comment, the issue has been fixed and merged into the main branch of maturin. Could you check using the latest version of maturin?
@Retto the issue is caused by that change to maturin, not fixed by it. Projects that use maturin as a dependency will need to update themselves to correct for the change. The instructions in my comment about adding a line to pyproject.yaml are for downstream applications.
I'm having the same problem, coming from trying to install mitmproxy though and having this project.version is required error
I HATE LINUX
Just opened a PR on graspologic-native to fix the issue: https://github.com/graspologic-org/graspologic-native/pull/45
I'm having the same problem, coming from trying to install mitmproxy though and having this project.version is required error
I HATE LINUX
this issue isn’t Linux's fault—it’s more like a Python package dependency hell!
We haven’t been tracking these specific dependency issues but I want to point out that there is another known dependency issue when using Python 3.12. It is with gensim to be more specific.
It is why we only run ci/cd tests against Python 3.10 and 3.11 right now.
Even with downgrading python version to 3.11 still getting issue with graspologic-native. Is anyone found work around to this?
PEP517 build of a dependency failed
Backend subprocess exited when trying to invoke build_wheel
| Command '['/tmp/tmpqziw7nf_/.venv/bin/python', '/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py', 'build_wheel', '/tmp/tmpgeoh94fg']' returned non-zero exit status 1.
|
| Running `maturin pep517 build-wheel -i /tmp/tmpqziw7nf_/.venv/bin/python --compatibility off`
| 💥 maturin failed
| Caused by: Cargo metadata failed. Do you have cargo in your PATH?
| Caused by: No such file or directory (os error 2)
| Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/tmpqziw7nf_/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with graspologic-native (1.2.3)
- 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).
You can verify this by running pip wheel --no-cache-dir --use-pep517 "graspologic-native (==1.2.3)".