Help Reading a file on mac is unable

I try to script the reading blocks inside a file to import them, but at th ebeginning I have no access to read my choosen file…

Any help, I am sure it is just an option to allow me accessing it…

import rhino
import rhinoscriptsyntax as rs

# Prompt the user to select a 3dm file
file_path = rs.OpenFileName("Open 3dm File", "3dm Files (*.3dm)|*.3dm|All Files (*.*)|*.*||")

# Open the file and get a list of block definitions
try:
    doc = Rhino.RhinoDoc.Open(file_path)
    block_defs = doc.Blocks.GetBlockList()
except Exception as e:
    print("An error occurred:", e)
    doc = None
    block_defs = []

# Display a list of block definitions to the user
selected_index = -1
if block_defs:
    names = [block.Name for block in block_defs]
    selected_index = rs.GetListBox("Select a block", names)

# Import the selected block definition into the current document
if selected_index >= 0:
    block_def = block_defs[selected_index]
    Rhino.RhinoDoc.ActiveDoc.Blocks.Import(block_def)

# Close the opened document
if doc:
    doc.Close()

Thanks for help

Don’t you need to capitalize the “Rhino” in import rhino ?

@Helvetosaur Yes you are right, and my .py file was not on the rhino folder, so now it starts, I can pick a .3dm file from a folder windows, but I have an error in retrieving a list from blocks inside…
Sorry for I am a beginner in Scripting, I understand logic, but still complex for syntax…