1、按照鏈接安裝
https://blog.csdn.net/m0_37937917/article/details/81159193
https://blog.csdn.net/qq_39905917/article/details/89460587
2、VScode import pyspark 報錯
from py4j.protocol import Py4JError
ModuleNotFoundError: No module named 'py4j'
解決方法:安裝py4j庫
一般的在cmd命令行下 pip install py4j 就可以。若是沒有將pip路徑添加到path中,就將路徑切換到python的Scripts中,然後再 pip install py4j 來安裝庫。