Получение ошибки при установке пакета «python dev»Python

Программы на Python
Ответить
Anonymous
 Получение ошибки при установке пакета «python dev»

Сообщение Anonymous »

У меня возникла проблема при установке python-dev, я пытаюсь запустить эту команду в папке с Python
python3 -m pip install python-dev-tools --user --upgrade

но на этом этапе возвращается эта ошибка
Collecting pydantic-core==2.27.1 (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,=1.7.4->fastapi>=0.65.1->flake8-fastapi=0->python-dev-tools)
Using cached pydantic_core-2.27.1.tar.gz (412 kB)
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Collecting maturin=1
Using cached maturin-1.7.4.tar.gz (191 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting typing-extensions!=4.7.0,>=4.6.0
Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Building wheels for collected packages: maturin
Building wheel for maturin (pyproject.toml): started
Building wheel for maturin (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

Building wheel for maturin (pyproject.toml) did not run successfully.
exit code: 1

[30 lines of output]
running bdist_wheel
running build
running build_py
creating build\lib.mingw_x86_64_ucrt-cpython-311\maturin
copying maturin\__init__.py -> build\lib.mingw_x86_64_ucrt-cpython-311\maturin
copying maturin\__main__.py -> build\lib.mingw_x86_64_ucrt-cpython-311\maturin
running egg_info
writing maturin.egg-info\PKG-INFO
writing dependency_links to maturin.egg-info\dependency_links.txt
writing requirements to maturin.egg-info\requires.txt
writing top-level names to maturin.egg-info\top_level.txt
reading manifest file 'maturin.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.json' under directory 'src\python_interpreter'
adding license file 'license-apache'
adding license file 'license-mit'
writing manifest file 'maturin.egg-info\SOURCES.txt'
running build_ext
running build_rust
error: can't find Rust compiler

If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

To update pip, run:

pip install --upgrade pip

and then retry package installation.

If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for maturin
Failed to build maturin
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (maturin)
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

Что касается Rust, я уже установил его, но его невозможно решить. Мне нужно установить его, потому что с моей программой, когда я ее запускаю, на этапе сбора numpy (из -r require.txt (строка 5)) у меня возникает такая ошибка
Collecting gym_cutting_stock@ git+https://github.com/martinakaduc/gym-cutting-stock (from -r requirements.txt (line 12))
Cloning https://github.com/martinakaduc/gym-cutting-stock to c:\users\nekomi\appdata\local\temp\pip-install-w6vbox2x\gym-cutting-stock_e70e8e817f554d8fbb9ea5efeec95264
Running command git clone --filter=blob:none --quiet https://github.com/martinakaduc/gym-cutting-stock 'C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\gym-cutting-stock_e70e8e817f554d8fbb9ea5efeec95264'
Resolved https://github.com/martinakaduc/gym-cutting-stock to commit 4ec81ef3d8e2b437a3208f75a063e6d491ae7214
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting gymnasium (from -r requirements.txt (line 1))
Using cached gymnasium-1.0.0-py3-none-any.whl.metadata (9.5 kB)
Requirement already satisfied: pip in d:\tieu_anh\mhh\assignment\mm241-assignment-main\mm241-assignment-main\.venv\lib\python3.11\site-packages (from -r requirements.txt (line 2)) (24.3.1)
Requirement already satisfied: pytest in d:\tieu_anh\mhh\assignment\mm241-assignment-main\mm241-assignment-main\.venv\lib\python3.11\site-packages (from -r requirements.txt (line 3)) (8.3.3)
Collecting cmake (from -r requirements.txt (line 4))
Using cached cmake-3.31.0.1.tar.gz (31 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy (from -r requirements.txt (line 5))
Using cached numpy-2.1.3.tar.gz (20.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
+ D:\Tieu_Anh\MHH\assignment\MM241-Assignment-main\MM241-Assignment-main\.venv\bin\python.exe C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154\vendored-meson\meson\meson.py setup C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154 C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154\.mesonpy-ik4d1_5t -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154\.mesonpy-ik4d1_5t\meson-python-native-file.ini
The Meson build system
Version: 1.5.2
Source dir: C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154
Build dir: C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154\.mesonpy-ik4d1_5t
Build type: native build
Project name: NumPy
Project version: 2.1.3
C compiler for the host machine: cc (gcc 14.2.0 "cc (Rev1, Built by MSYS2 project) 14.2.0")
C linker for the host machine: cc ld.bfd 2.43.1
C++ compiler for the host machine: c++ (gcc 14.2.0 "c++ (Rev1, Built by MSYS2 project) 14.2.0")
C++ linker for the host machine: c++ ld.bfd 2.43.1
Cython compiler for the host machine: cython (cython 3.0.11)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python found: YES (D:\Tieu_Anh\MHH\assignment\MM241-Assignment-main\MM241-Assignment-main\.venv\bin\python.exe)
Found pkg-config: YES (C:\msys64\ucrt64\bin\pkg-config.EXE) 2.3.0
Run-time dependency python found: YES 3.11
Has header "Python.h" with dependency python-3.11: NO

..\meson.build:44:2: ERROR: Problem encountered: Cannot compile `Python.h`. Perhaps you need to install python-dev|python-devel

A full log can be found at C:\Users\Nekomi\AppData\Local\Temp\pip-install-w6vbox2x\numpy_a4520cf52fea46d7871c55fc99b18154\.mesonpy-ik4d1_5t\meson-logs\meson-log.txt
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.


Подробнее здесь: https://stackoverflow.com/questions/792 ... ev-package
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»