一,下载pylucene安装包
下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/lucene/pylucene/pylucene-9.7.0-src.tar.gz
官网根本没网速
二,解压
D:\install\pro\python\pylucene-9.7.0\jcc
在命令行下进入 jcc 文件夹,输入 python setup.py build ,如果没有错误信息,继续输入 python setup.py install 安装 JCC 。重启电脑
教程:https://www.cnblogs.com/hanhaotian/p/13361691.html
三、Can’t determine where the Java JDK has been installed on this machine.
Please set the environment variable JCC_JDK to that location before
running setup.py.
下载地址:https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_windows-x64_bin.zip
JCC_JDK D:\ide\jdk-21.0.1
四、出现:Microsoft Visual C++ 14.0 is required 的解决方案
下载地址:
生成工具
https://download.visualstudio.microsoft.com/download/pr/ebbb3a8f-0b8f-4c9d-ac08-5e244e84b4fe/d4e08524cb0e5bd061a24f507928d1cfb91dce192c5e12ed964b8343fc4cdedd/vs_BuildTools.exe
或者完整开发工具
https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030:5f0f8ce6355245eda6fbb9ba37b6d7ee
C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe
五、很多解决方案都是错的!我是安装以下方法编译成功:
https://www.cnblogs.com/ToDoToTry/p/11970611.html
Windows平台上,pip install fastFM scrapy等工具的时候,经常出现 error Microsoft Visual C++ 14.0 is required 的错误,
原因是部分python包是使用c或者c++编写的,因此在安装的时候需要使用 c++生成工具集。
解决方案有两个:
到 https://www.lfd.uci.edu/~gohlke/pythonlibs 下载编译好的包
安装vc++ 14 build tools :
安装 visual studio 最新版, 选择 vc++ build tools 和 windows sdk 10
最关键: pip install --upgrade setuptools 才能自动发现 vc++ compilers ( Before do anything, install or upgrade the Setuptools Python package. It contain compatibility improvements and add automatic use of compilers:)
六、在命令行下进入 jcc 文件夹,输入 python setup.py build ,如果没有错误信息,继续输入 python setup.py install 安装
Finished processing dependencies for JCC==3.13