当我使用tensorflow和spark-submit
sample.py
一起运行pyspark程序时,它说没有名为tensorflow
的模块,但是当我运行激活tensorflow并使用python sample.py
运行时说没有名为pyspark的模块。
import tensorflow as tf
import pyspark # only run after findspark.init()
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
df = spark.sql('''select 'spark' as hello ''')
df.show()