Cannot run another notebook from same directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 10:47 AM
Hello, I am having a similar problem from this thread which was never resolved: https://community.databricks.com/t5/data-engineering/unexpected-error-while-calling-notebook-string-...
I renamed a notebook (utility_data_wrangling) which I am using in my current notebook. When I do
Failed to parse %run command: string matching regex `\$[\w_]+' expected but `%' found. If notebook path contains spaces, wrap with double quotes. Stacktrace: /Shared/Inbound Forecasting/testing_error: python
This seems to break something fundamentally because now %run "./utility_metrics" will give the same error even when commenting out %run "./utility_data_wrangling"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 06:54 PM
The error message indicates that the notebook name contains special characters, please modify the notebook name to contain only English letters, and remove double quotation marks
%run ./utility123
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 08:39 AM
It has no special characters, like I mentioned it's just utility_data_wrangling. It does not work with or without the double quotation marks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2025 10:09 AM
I am running into the same issue. It seems like the `%run` magic command is trying to parse the entire cell content as its arguments. So if you have
%run "my_notebook"
print("hello")in the same cell, you will get the following error: `Failed to parse %run command: string matching regex '\$[\w_]+' expected but 'p' found. If notebook path contains spaces, wrap with double quotes.` But if you remove the `print("hello")`, it will run fine.
This is quite frustrating and I would assume that it's a bug.