Blender scripting cannot find my module

Hey guys, i was following a old blender scripting book using blender 2.78c.
everything works fine for me, and today i switched to blender 2.93. then my scripts won’t work anymore,
basically I have 2 python files (, in my workspace folder, I imported module ‘’ into ‘’, then it crashed with “no module named a”
my and were in same folder, do i have to put all code into blender 2.93 root folder to make it work? what make me feel confused is i didn;t modified anything, folder structure are the same. the only change is i switched to 2.93///

here is code


import ut
import importlib

import bpy

#Will fail is scene is empty

bpy.ops.mesh.primitive_uv_sphere_add(size=0.5, location=(0,0,0))


import bpy
import bmesh
if name == “main”:

I’m not sure why, but in blender you need to use a relative import:
from . import ut

Also, while a scripting book for 2.78 might be useful in some cases, the API has changed a lot since then, and you would probably be better finding something from more recently if you want to learn blender scripting…

This is a good series to get started with:

And this one’s good once you’ve found your feet a bit:

Hope that helps!

thanks, i searched a lot about the new video, but mostly were developed within blender, i prefer to use vs code. do you have any resource for that?

Most of the same concepts apply when using VS Code. The scripting for artists series starts in blender, but then moves to VS Code layer on.
There is also a very good VS Code extension called Blender development by Jacques Lucke, that lets you auto reload your scripts.
Either way, there are some things that are easier in blender’s text editor, so it’s not a bad idea to start off using it.

1 Like

Thanks, i’ll take a look at it

1 Like
1 Like