背景
实现PDF转图片,需要使用fitz,结果安装的时候出现问题。
先上解决方案,再进行问题分析.
解决方案
安装PyMuPDF能直接使用fitz,按照介绍PyMuPDF也叫称为fitz库。
pip install PyMuPDF
问题分析
关键报错信息:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for traits
Failed to build traits
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (traits)
拆分成两个问题看:
1、error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
首先看到是微软组件包的问题,网上推荐都是要下载安装visualstudio组件包,感觉这个非必要,所以没操作。
2、ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (traits)
执行下面命令安装setuotools wheel后,在安装也是
# 安装setuptools和wheel这两个Python包,它们是处理pyproject.toml文件所必需的
pip install setuptools wheel