赞
踩
在运行程序时,出现ModuleNotFoundError: No module named 'pycuda’的错误,尝试多种方法最终解决。
尝试方法:
pip install pycuda
出现报错:
Installing build dependencies ... error error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [3 lines of output] WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/setuptools/ ERROR: Could not find a version that satisfies the requirement setuptools (from versions: none) ERROR: No matching distribution found for setuptools [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. note: This error originates from a subprocess, and is likely not a problem with pip.
经过查阅资料,使用源安装,最终解决。
pip install pycuda -i https://mirrors.aliyun.com/pypi/simple/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。