Fastparquet安装报错:构建Wheel依赖获取失败(退出码1)求助
fastparquet安装失败问题解决
我无编程基础,跟着一本用NFL橄榄球数据讲解数据科学的书学习,开篇需要安装nfl_data_py包,但安装时出错,排查后发现是fastparquet安装失败。我已经确认能从命令行运行Python和pip,也更新了pip、setuptools和wheel,还按要求装了fastparquet的依赖,但还是遇到以下错误:
C:\Users\erict\AppData\Local\Programs\Python\Python312\Scripts>pip install fastparquet Collecting fastparquet Using cached fastparquet-2023.8.0.tar.gz (393 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [28 lines of output] Traceback (most recent call last): File "C:\Users\erict\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\erict\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\erict\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\erict\AppData\Local\Temp\pip-build-env-v_fmec96\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\erict\AppData\Local\Temp\pip-build-env-v_fmec96\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires self.run_setup() File "C:\Users\erict\AppData\Local\Temp\pip-build-env-v_fmec96\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\erict\AppData\Local\Temp\pip-build-env-v_fmec96\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup exec(code, locals()) File "<string>", line 47, in <module> File "C:\Users\erict\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 389, in call with Popen(*popenargs, **kwargs) as p: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\erict\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\erict\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel 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
问题原因
你使用的Python3.12是较新版本,而你安装的fastparquet2023.8.0不支持Python3.12,pip只能尝试从源码编译安装,但编译需要C++构建工具,最终导致出现「找不到文件」的错误。
解决步骤
方法1:升级fastparquet到兼容版本
打开命令行运行以下命令,安装支持Python3.12的最新版fastparquet:pip install --upgrade fastparquet最新版已适配Python3.12,可直接安装预编译包,无需编译。
方法2:降级Python版本
如果升级fastparquet后仍有问题,可以将Python降级到3.11版本,该版本与fastparquet2023.8.0完全兼容,安装过程不会出现编译问题。方法3:安装C++构建工具(坚持用Python3.12时)
下载安装Microsoft Visual C++ Build Tools,安装时必须勾选「Desktop development with C++」组件,安装完成后重启命令行,再尝试安装fastparquet。
内容的提问来源于stack exchange,提问作者EricT
相关产品推荐
相关产品推荐

