<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Enable to use library GraphFrames in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126718#M47747</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to install and use the library GraphFrames but keep receiving the following error: "&lt;SPAN class=""&gt;AttributeError: &lt;/SPAN&gt;&lt;SPAN&gt;'SparkSession' object has no attribute '_sc'&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;I have tried to install the library on my all-purpose cluster (Access mode: Standard). The installation works, but the code not. I am using the library version "&lt;SPAN&gt;graphframes:graphframes:0.8.4-spark3.5-s_2.13" and my spark version is 3.5.2.&lt;BR /&gt;I have also tried to install the library via pip install but no success either.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Does anyone know how to make it work ? I would like to avoid having to change my cluster's access mode.&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Sacha&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 15:17:06 GMT</pubDate>
    <dc:creator>sachamourier</dc:creator>
    <dc:date>2025-07-28T15:17:06Z</dc:date>
    <item>
      <title>Enable to use library GraphFrames</title>
      <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126718#M47747</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to install and use the library GraphFrames but keep receiving the following error: "&lt;SPAN class=""&gt;AttributeError: &lt;/SPAN&gt;&lt;SPAN&gt;'SparkSession' object has no attribute '_sc'&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;I have tried to install the library on my all-purpose cluster (Access mode: Standard). The installation works, but the code not. I am using the library version "&lt;SPAN&gt;graphframes:graphframes:0.8.4-spark3.5-s_2.13" and my spark version is 3.5.2.&lt;BR /&gt;I have also tried to install the library via pip install but no success either.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Does anyone know how to make it work ? I would like to avoid having to change my cluster's access mode.&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Sacha&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 15:17:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126718#M47747</guid>
      <dc:creator>sachamourier</dc:creator>
      <dc:date>2025-07-28T15:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Enable to use library GraphFrames</title>
      <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126722#M47750</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/122091"&gt;@sachamourier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Maybe try to use Databricks Runtime ML which already includes an optimized installation of GraphFrames?&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/integrations/graphframes/#databricks-runtime-recommendation-for-graphframes" target="_blank"&gt;How to use GraphFrames on Azure Databricks - Azure Databricks | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 15:40:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126722#M47750</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-07-28T15:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Enable to use library GraphFrames</title>
      <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126727#M47751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/122091"&gt;@sachamourier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;But if you don't want to use different runtime then you need to change access mode. In standard access mode you don't have access to SparkContext which this library requires. Hence you're getting a an error like "&lt;SPAN&gt;'SparkSession' object has no attribute '_sc'&lt;/SPAN&gt;&lt;SPAN&gt;" (where _sc refers to SparkContext).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_1-1753719122338.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/18581i5AC7599B4277E129/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_1-1753719122338.png" alt="szymon_dybczak_1-1753719122338.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 16:19:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126727#M47751</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-07-28T16:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Enable to use library GraphFrames</title>
      <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126732#M47753</link>
      <description>&lt;P&gt;And yes, I can confirm that it works in dedicated access mode. I've used following code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;pip install graphframes-py

from functools import reduce
from pyspark.sql import functions as F
from graphframes import GraphFrame

nodes = [
    (1, "Alice", 30),
    (2, "Bob", 25),
    (3, "Charlie", 35)
]
nodes_df = spark.createDataFrame(nodes, ["id", "name", "age"])

edges = [
    (1, 2, "friend"),
    (2, 1, "friend"),
    (2, 3, "friend"),
    (3, 2, "enemy")  # eek!
]
edges_df = spark.createDataFrame(edges, ["src", "dst", "relationship"])

g = GraphFrame(nodes_df, edges_df)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And as you can see it works as expected:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_0-1753719964171.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/18583iAAF3B7D6B4440A19/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_0-1753719964171.png" alt="szymon_dybczak_0-1753719964171.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;One thing to remember,&amp;nbsp;&lt;EM&gt;Python distribution does not include JVM-core. So I had to install also this version of library on my cluster :&amp;nbsp;&lt;A target="_blank"&gt;graphframes:graphframes:0.8.3-spark3.5-s_2.13&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_1-1753720000895.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/18584iEB8941D46C2E8A2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_1-1753720000895.png" alt="szymon_dybczak_1-1753720000895.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_2-1753720046159.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/18585iC6BE743E1BCFD2FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_2-1753720046159.png" alt="szymon_dybczak_2-1753720046159.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 16:28:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126732#M47753</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-07-28T16:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Enable to use library GraphFrames</title>
      <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126767#M47766</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;&amp;nbsp;Thanks for the responses. I indeed changed my all-purpose cluster access mode and it worked. I figured that was a nicest option than changing the runtime.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 07:28:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126767#M47766</guid>
      <dc:creator>sachamourier</dc:creator>
      <dc:date>2025-07-29T07:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Enable to use library GraphFrames</title>
      <link>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126768#M47767</link>
      <description>&lt;P&gt;Cool, great that it worked for you!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 07:34:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/enable-to-use-library-graphframes/m-p/126768#M47767</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-07-29T07:34:08Z</dc:date>
    </item>
  </channel>
</rss>

