安装 requirements.txt 时报错,是否一定要安装 3.10 虚拟环境?

作者: FleshCannon创建于 2025年10月26日更新于 2025年12月23日

I did not install the 3.10 virtual environment with conda, and my local Python is 3.13. When I installed requirements.txt, an error occurred, and the information is as follows: Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. exit code: 1 ╰─> [21 lines of output] + C:\Users\gy\AppData\Local\Programs\Python\Python313\Python.exe C:\Users\gyhua\AppData\Local\Temp\pip-install-x4kh0v07\numpy_a0c34602b72a4b5abd7523f00e98592c\vendored-meson\meson\meson.py setup C:\Users\gy\AppData\Local\Temp\pip-install-x4kh0v07\numpy_a0c34602b72a4b5abd7523f00e98592c C:\Users\gy\AppData\Local\Temp\pip-install-x4kh0v07\numpy_a0c34602b72a4b5abd7523f00e98592c\.mesonpy-eek83m3f -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\gy\AppData\Local\Temp\pip-install-x4kh0v07\numpy_a0c34602b72a4b5abd7523f00e98592c\.mesonpy-eek83m3f\meson-Python-native-file.ini The Meson build system Version: 1.2.99 Source dir: C:\Users\gy\AppData\Local\Temp\pip-install-x4kh0v07\numpy_a0c34602b72a4b5abd7523f00e98592c Build dir: C:\Users\gy\AppData\Local\Temp\pip-install-x4kh0v07\numpy_a0c34602b72a4b5abd7523f00e98592c\.mesonpy-eek83m3f Build type: native build Project name: NumPy Project version: 1.26.4 WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe ..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc'] The following exception(s) were encountered: Running `icl ""` gave "[WinError 2] The system cannot find the file specified." Running `cl /?` gave "[WinError 2] The system cannot find the file specified." Running `cc --version` gave "[WinError 2] The system cannot find the file specified." Running `gcc --version` gave "[WinError 2] The system cannot find the file specified." Running `clang --version` gave "[WinError 2] The system cannot find the file specified." Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified." Running `pgcc --version` gave "[WinError 2] The system cannot find the file specified." Ignore the error, complete the subsequent installation, and finally, when running, it says that the CV2 module was not found, so is it because the 3.10 virtual environment was not installed?

内容来源: Zeyi-Lin/HivisionIDPhotos