# node named ‘my\_python\_model’ was not found

**URL:** <https://discourse.getdbt.com/t/node-named-my-python-model-was-not-found/5107>\
**Category:** Help\
**Tags:** python-models, snowflake, dbt-cloud\
**Created:** [October 18, 2022, 1:39am UTC](https://discourse.getdbt.com/t/node-named-my-python-model-was-not-found/5107 "2022-10-18T01:39:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zmoxie](https://avatars.discourse-cdn.com/v4/letter/z/a88e57/32.png) [@zmoxie](https://discourse.getdbt.com/u/zmoxie)\
**Post date:** [October 18, 2022, 1:39am UTC](https://discourse.getdbt.com/t/node-named-my-python-model-was-not-found/5107/1 "2022-10-18T01:39:51Z")

</div>

This is the model structure:

![image](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/2X/4/4e91301100340ca3d683f2b181df879d39953bbf.png)

Python model defination:  
、、、

def model(dbt, sesion):  
dbt.config(  
materialized=‘table’  
)

```
# these are DAG-aware, and return dataframes
dim_all_learners = dbt.ref("cq_temperature")
# source_thinkific_users = dbt.source("year", "temp")

philly_sample = dim_all_learners
                    .filter(col("temp">0))
                    .limit(1000)

import numpy as np
from sklearn.linear_model import LinearRegression
...
	
# your final 'select' statement
df = philly_sample.select("*")

return df

```

、、、

Then it’s running into error:

_Server error: RPC server failed to compile project, call the “status” method for compile status: Compilation Error in model demo (models/demo/demo.sql)_  
_Model ‘model.my\_new\_project.demo’ (models/demo/demo.sql) depends on a node named ‘my\_python\_model’ which was not found_

So, how can I define and refer to a python model? I followed the document and failed. THanks !

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [October 18, 2022, 1:57am UTC](https://discourse.getdbt.com/t/node-named-my-python-model-was-not-found/5107/2 "2022-10-18T01:57:27Z")

</div>

@zmoxie are you using dbt Core v1.3? If not, then dbt doesn’t know about python models and will ignore your `my_python_model.py` file when evaluating `ref`s.

---

<div class="post-metadata">

**Author:** ![zmoxie](https://avatars.discourse-cdn.com/v4/letter/z/a88e57/32.png) [@zmoxie](https://discourse.getdbt.com/u/zmoxie)\
**Post date:** [October 18, 2022, 2:15am UTC](https://discourse.getdbt.com/t/node-named-my-python-model-was-not-found/5107/3 "2022-10-18T02:15:03Z")

</div>

Thanks @joellabes . It’s working well.

I am new to dbt and got a confusion on the env setting. I configed the dbt core1.3 for the wrong env.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [October 25, 2022, 2:15am UTC](https://discourse.getdbt.com/t/node-named-my-python-model-was-not-found/5107/4 "2022-10-25T02:15:41Z")

</div>

Closed on October 25, 2022, 2:15am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
