赞
踩
ERROR: Failed building wheel for pycuda
C:\Users\97160\AppData\Local\Temp\pip-install-oi8pc0pg\pycuda_49ea4802a21a4336a69368c192f9cfce\src\cpp\cuda.hpp(23): fatal error C1083: 无法打开包括文件: “cudaProfiler.h”: No such file or directory C:\Users\97160\AppData\Local\Temp\pip-build-env-0snks3gb\overlay\Lib\site-packages\setuptools\command\build_py.py:201: _Warning: Package 'pycuda.cuda' is absent from the `packages` configuration. !! ******************************************************************************** ############################ # Package would be ignored # ############################ Python recognizes 'pycuda.cuda' as an importable package[^1], but it is absent from setuptools' `packages` configuration. This leads to an ambiguous overall configuration. If you want to distribute this package, please make sure that 'pycuda.cuda' is explicitly added to the `packages` configuration field. Alternatively, you can also rely on setuptools' discovery methods (for example by using `find_namespace_packages(...)`/`find_namespace:` instead of `find_packages(...)`/`find:`). You can read more about "package discovery" on setuptools documentation page: - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html If you don't want 'pycuda.cuda' to be distributed and are already explicitly excluding 'pycuda.cuda' via `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`, you can try to use `exclude_package_data`, or `include-package-data=False` in combination with a more fine grained `package-data` configuration. You can read more about "package data files" on setuptools documentation page: - https://setuptools.pypa.io/en/latest/userguide/datafiles.html [^1]: For Python, any directory (with suitable naming) can be imported, even if it does not contain any `.py` files. On the other hand, currently there is no concept of package data directory, all directories are treated like packages. ******************************************************************************** !! check.warn(importable) error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pycuda Failed to build pycuda ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects
pip download pycuda
tar -xvf pycuda-<version>.tar.gz
cd pycuda-<version>
python configure.py
python configure.py --cuda-root="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6"
pip install .
通过运行 configure.py 配置编译参数,可以解决 pycuda 安装过程中遇到的问题。这些步骤确保编译器能够找到所需的 CUDA 文件。以下是完整的操作流程:
确保 CUDA 工具包安装正确并且环境变量设置正确。如果有任何问题,请检查 README_SETUP.txt 文件中的详细说明。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。