Had the same error. You have to run appbuilder.init_app() for your app:

..
..
class RubyAPP(object):
    def __init__(self, config_name):
        # App manager
        app.config.from_pyfile('config.py')
        db.init_app(app)

        with app.app_context():
            appbuilder.init_app(app, db.session)
..
..
Answer from frans on Stack Overflow
🌐
GitHub
github.com › delta-io › delta › issues › 1724
[BUG] DeltaMergeBuilder' object has no attribute 'whenNotMatchedBySource for 2.3.0 · Issue #1724 · delta-io/delta
April 26, 2023 - import pandas as pd import pyspark from pyspark.sql import functions as F from pyspark.sql import SparkSession from delta import * def get_pyspark_config(): return { "spark.master": "local[2]", "spark.driver.memory": "2G", "spark.sql.extensions":"io.delta.sql.DeltaSparkSessionExtension", "spark.sql.catalog.spark_catalog":"org.apache.spark.sql.delta.catalog.DeltaCatalog", "spark.jars.packages": "io.delta:delta-core_2.12:2.3.0", } s_config = get_pyspark_config() builder = SparkSession.builder.appName("delta_testing").master('local[2]') for key, value in s_config.items(): builder = builder.config(key, value) spark = builder.getOrCreate() spark.sparkContext.setLogLevel('ERROR') spark ·
Author   geoHeil
Discussions

python - pyspark error: AttributeError: 'SparkSession' object has no attribute 'parallelize' - Stack Overflow
I am using pyspark on Jupyter notebook. Here is how Spark setup: import findspark findspark.init(spark_home='/home/edamame/spark/spark-2.0.0-bin-spark-2.0.0-bin-hadoop2.6-hive', python_path='pytho... More on stackoverflow.com
🌐 stackoverflow.com
AttributeError: 'builtin_function_or_method' object has no attribute

As I'm not getting much help with my original question I did some research and rewrote the pyspark.sql query as follows:

#%%
import findspark
findspark.init('/home/packt/spark-2.1.0-bin-hadoop2.7')
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName('ops').getOrCreate()
df = spark.read.csv('/home/packt/Downloads/Spark_DataFrames/Person_Person.csv',inferSchema=True,header=True)
df.createOrReplaceTempView('Person_Person')
myresults = spark.sql("""SELECT
PersonType
,COUNT(PersonType) AS \Person Count`FROM Person_PersonGROUP BY PersonType""")myresults.collect()result = myresults.collect()resultresult.saveAsTextFile("test")`

However, I'm now getting the following error message:

AttributeError Traceback (most recent call last) <ipython-input-9-9e137ed161cc> in <module>() ----> 1 result.saveAsTextFile("test") AttributeError: 'list' object has no attribute 'saveAsTextFile'

Hopefully, this will get more responses to help me fix this issue

Thanks

More on reddit.com
🌐 r/PySpark
1
1
August 5, 2018
AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'fp16_mode'
Description I want to use tensorrt-8.2.2.1 convert my onnx model to tensorrt, but I get an AttributeError when I try to build a engine. AttributeError: 'tensorrt.tensorrt.Builder' object ha... More on github.com
🌐 github.com
4
March 1, 2022
Trouble with spark code in Notebook, 'str' object has no attribute 'option
I can't debug this. I copied it from a Databricks video, so maybe it does not transfer over???? import sys from pyspark import SparkContext from pyspark.sql import SparkSession from pyspark.sql.types import * spark = SparkSession \ … More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
🌐
Nenad Bozinovic
nenadbozinovic.com › tips › 010_Python › pyspark_apriori.html
Project: Apriori Algorithm for Finding Frequent Itemsets with PySpark – Nenad Bozinovic
from pyspark.sql import SparkSession ...n.builder.appName("example") ... data = [("Alice", 1), ("Bob", 2), ("Cathy", 3)] df = spark.createDataFrame(data, ["Name", "Value"]) df.show() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[8], line 2 1 data = [("Alice", 1), ("Bob", 2), ("Cathy", 3)] ----> 2 df = spark.createDataFrame(data, ["Name", "Value"]) 4 df.show() AttributeError: 'Builder' object has no attribute ...
🌐
Reddit
reddit.com › r/pyspark › attributeerror: 'builtin_function_or_method' object has no attribute
r/PySpark on Reddit: AttributeError: 'builtin_function_or_method' object has no attribute
August 5, 2018 -

Hello community,

I am trying to collect and send the results from a pyspark query to a textfile.

However, I keep on getting the error:

AttributeError: 'builtin_function_or_method' object has no attribute example8

I'm extremely new to pyspark.sql. The code is as follows:

#%%

import sys

from operator import add

from pyspark.sql import SparkSession

spark = SparkSession.builder.appName('aggs').getOrCreate()

df = spark.read.csv('/home/packt/Downloads/Spark_DataFrames/sales_info.csv',inferSchema=True,header=True)

example8 = spark.sql("""SELECT

*

FROM sales_info

ORDER BY Sales DESC""")

print.example8.collect()

example8.saveAsTextFile("/home/packt/test.txt")

read_rdd = sc.textFile("/home/packt/test.txt")

read_rdd.collect()

main()

The full error message is as follows:

Append ResultsClear Results

--------------------------------------------------------------------------- AttributeError                            Traceback (most recent call last) <ipython-input-42-714a9bbd2b92> in <module>()      74 FROM sales_info      75 ORDER BY Sales DESC""") ---> 76 print.example8.collect()      77       78 example8.saveAsTextFile("/home/packt/test.txt") AttributeError: 'builtin_function_or_method' object has no attribute 'example8'

Any help figuring out the error will be greatly appreciated.

Thanks

🌐
Cloudera Community
community.cloudera.com › t5 › Support-Questions › AttributeError-in-Spark › td-p › 185732
Solved: AttributeError in Spark - Cloudera Community - 185732
July 18, 2018 - Error : AttributeError: 'HiveContext' object has no attribute 'load' ... In spark 2 you should leverage spark session instead of spark context. To read jdbc datasource just use the following code: from pyspark.sql import SparkSession from pyspark.sql import Row spark = SparkSession \ .builder \ .appName("data_import") \ .config("spark.dynamicAllocation.enabled", "true") \ .config("spark.shuffle.service.enabled", "true") \ .enableHiveSupport() \ .getOrCreate() jdbcDF2 = spark.read \ .jdbc("jdbc:sqlserver://10.24.40.29;database=CORE;username=user1;password=Passw0rd", "test")
🌐
GitHub
github.com › NVIDIA › TensorRT › issues › 1820
AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'fp16_mode' · Issue #1820 · NVIDIA/TensorRT
March 1, 2022 - TRT_LOGGER = trt.Logger(trt.Logger.WARNING) trt_runtime = trt.Runtime(TRT_LOGGER) def build_engine(onnx_path, seq_len): with trt.Builder(TRT_LOGGER) as builder: network = builder.create_network(1) config = builder.create_builder_config() parser = trt.OnnxParser(network, TRT_LOGGER) profile = builder.create_optimization_profile() profile.set_shape('input', (1, seq_len), (32, seq_len), (64, seq_len)) profile.set_shape('input_mask', (1, seq_len), (32, seq_len), (64, seq_len)) config.add_optimization_profile(profile) config.max_workspace_size = (1 << 32) builder.max_batch_size = 64 builder.fp16_mode = True builder.int8_mode = True with open(onnx_path, 'rb') as model: parser.parse(model.read()) engine = builder.build_serialized_network(network, config) return engine engine = build_engine(onnx_path, 128)
Author   snailkn
🌐
Google Groups
groups.google.com › g › kivy-users › c › 7oZ0o3Er02o
help with AttributeError: object has no attribute
December 9, 2022 - on_release: app.next() #event reference to function · The problem is that the next() method is not defined in app, it is defined in forgot_passwords. Change the on_release line:
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 927325 › trouble-with-spark-code-in-notebook-str-object-has
Trouble with spark code in Notebook, 'str' object has no attribute 'option - Microsoft Q&A
import sys from pyspark import SparkContext from pyspark.sql import SparkSession from pyspark.sql.types import * spark = SparkSession \ .builder \ .appName("Validate") \ .getOrCreate custumSchema = StructType([ StructField("A#", IntegerType(), True), StructField("FirstName", StringType(), True),\ StructField("LastName", StringType(), True),\ StructField("DOB",DateType(), True),\ StructField("Gender", StringType(), True ),\ StructField("corrupt_record", StringType(), True )\ ]) df = spark.read\ .format='csv' \ .option("badRecordsPath", 'abfssXXXXXXCSV/BadCSV/*.csv')\ .option("mode", "PERMISSIVE")\ .options(header='true', delimiter=',',) \ .option("columnNameOfCorruptRecord", "corrupt_record") \ .load('abfss://synapXXXXXXXCSV/*.csv', schema = custumSchema) df.show()
🌐
Stack Overflow
stackoverflow.com › questions › 71978370 › using-builder-pattern-i-got-attributeerror-nonetype-object-has-no-attribute
python - Using Builder Pattern, I got AttributeError: 'NoneType' object has no attribute to builder class function - Stack Overflow
97 Builder pattern equivalent in Python · 0 instance has no attribute (python) 5 Python Classes ( AttributeError: '' object has no attribute '') 2 AttributeError: <class> instance has no attribute · 1 AttributeError: instance has no attribute · 4 AttributeError: 'NoneType' object has no attribute ·
🌐
Cloudera Community
community.cloudera.com › t5 › Advanced-Analytics-Apache-Spark › Pyspark-issue-AttributeError-DataFrame-object-has-no › td-p › 78093
Pyspark issue AttributeError: 'DataFrame' object has no attribute 'saveAsTextFile'
January 2, 2024 - AttributeError: 'DataFrame' object has no attribute 'saveAsTextFile' Can someone take a look at the code and let me know where I'm going wrong: #%% import findspark findspark.init('/home/packt/spark-2.1.0-bin-hadoop2.7') from pyspark.sql import SparkSession def main(): spark = SparkSession.builder.appName('aggs').getOrCreate() df = spark.read.csv('/home/packt/Downloads/Spark_DataFrames/sales_info.csv',inferSchema=True,header=True) df.createOrReplaceTempView('sales_info') example8 = spark.sql("""SELECT * FROM sales_info ORDER BY Sales DESC""") example8.saveAsTextFile("juyfd") main()
🌐
MungingData
mungingdata.com › pyspark › sparksession-getorcreate-getactivesession
Creating and reusing the SparkSession with PySpark - MungingData
from pyspark.sql import SparkSession spark = (SparkSession.builder .master("local") .appName("chispa") .getOrCreate()) getOrCreate will either create the SparkSession if one does not already exist or reuse an existing SparkSession.
🌐
Dataiku Community
community.dataiku.com › questions & discussions › using dataiku
PySpark Recipes persist DataFrame — Dataiku Community
April 15, 2020 - spark = SparkSession.builder.config(conf=config).getOrCreate() sc = SQLContext(spark)
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-attributeerror-object-has-no-attribute
How to fix AttributeError: object has no attribute - GeeksforGeeks
July 23, 2025 - To understand this error, we first have to know how to read the error message effectively. It typically consists of two parts: "AttributeError" and "Object has no attribute." The former indicates the type of error, and the latter suggests that the attribute we are trying to access does not exist for the object.
🌐
Apache
lists.apache.org › thread › 3ymr68dj6pq0q50z3zgjx2ycs3cdmx9p
'Builder' object has no attribute 'is_streaming_mode'
May 31, 2021 - Email display mode: · Modern rendering · Legacy rendering · This site requires JavaScript enabled. Please enable it
🌐
GitHub
github.com › jpmml › pyspark2pmml › issues › 11
AttributeError: 'PMMLPipeline' object has no attribute '_to_java' · Issue #11 · jpmml/pyspark2pmml
July 19, 2018 - from pyspark.ml import Pipeline from pyspark2pmml import PMMLBuilder from pyspark.mllib.regression import LabeledPoint from pyspark.ml.regression import RandomForestRegressor from pyspark import sql, SparkConf, SparkContext spark = SparkSession \ .builder \ .appName("Python Spark SQL basic example") \ .config("spark.some.config.option", "some-value") \ .getOrCreate() df = spark.read.load(tsv_data_path, format="csv", sep=",", header="true") df_n = df.rdd.map(lambda row: LabeledPoint(row[label_idx], row[:label_idx-1])).toDF(["features", "label"]) as_ml = udf(lambda v: v.asML() if v is not None e
Author   okoutb
🌐
wxPython
discuss.wxpython.org › wxpython users
AttributeError: 'module' object has no attribute 'App' - wxPython Users - Discuss wxPython
April 14, 2010 - Hi All, A newbie question ... I got the 2.8 source to build with unicode enabled in debug mode. However, upon attempting to run demo.py I get: Traceback (most recent call last): File "demo.py", line 3, in import Main File "/home/pstanczyk/Downloads/wxPython-src-2.8.10.1/wxPython/demo/ Main.py", line 355, in class MyLog(wx.PyLog): AttributeError: 'module' object has no attribute 'PyLog' Furthermore, trying the hello world example from the wiki I get: impo...
🌐
Stack Overflow
stackoverflow.com › questions › 76487619 › attributeerror-getbuilder-object-has-no-attribute-with-additional
python - AttributeError: 'GetBuilder' object has no attribute 'with_additional' - Stack Overflow
In Weaviate vector db I get an AttributeError: 'GetBuilder' object has no attribute 'with_additional'. I want to get an id of an object I want to get an id of an object. For that I have used