cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Compute - sys path not working

gmont4m
New Contributor
We were working with Python scripts on serverless (Git folder). The following code worked when we were calling on custom modules in sitting in the python scripts (eg. preprocess data from preprocessing.py). We've moved to shared compute but can no longer access these modules. We are still in development.
I would appreciate any insight if anyone has worked with this issue?
 
import subprocess
import sys
import os
import importlib
print(os.getcwd())
repo_root = "/Workspace/dept_ai/Group23/project832"
sys.path.append("/Workspace/dept_ai/Group23/project832/models/components/")
sys.path.append("/Workspace/dept_ai/Group23/project832/models/base_models/")
from preprocessing import preprocess_data
 
ModuleNotFoundError: No module named 'preprocessing'
1 REPLY 1

nayan_wylde
Honored Contributor

It seems you are using a workspace path. To confirm are you using a dedicated compute with access provided to a group. You need to provide can mange access to workspace path to the group.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now