解决“java not found and java_home environment variable is not set. install java and set java_home to point to the java installation directory.”,在Pycharm中正确配置pyspark 问题描述: 在pycharm中安装pyspark库,运行时,出现以下报错: java not found and java_home environment variable is not set. install java and set java_home to point to the java installation directory. Exception: Java gateway process exited before sending its port number 解决: 1.Anaconda Prompt中安装pyspark 2. 打开Pycharm,点击RUN---->Edit Configurations---->Configuration----->Environment---->Environment variables 点击+,输入变量名称及变量路径: PYTHONPATH D:\ProgramData\Anaconda3\Lib\site-packages\pyspark\python SPARK_HOME D:\ProgramData\Anaconda3\Lib\site-packages\pyspark JAVA_HOME D:\ProgramData\Anaconda3\Lib\site-packages\pyspark\jars 3.保存,重新运行代码即可。
|