Hi. I am registered custom block. Then I try impor...
# ask-community
a
Hi. I am registered custom block. Then I try import it:
Copy code
from __prefect_loader__ import CustomBlockName
But I get an error: ModuleNotFoundError: No module named '__prefect_loader__' How can I fix it?
j
Hi! I am also running into this. Same exact scenario - did you ever find a fix for it?
e
@Emil Christensen this is also the error that I am running into that was in regards to custom blocks mentioned in our call last week. Do you have any insight for this?
e
My understanding is that
__prefect_loader__
is just a placeholder there. The
CustomBlockName
needs to be imported and available wherever you’re using it (i.e. in your flow code). You can also set
PREFECT_EXTRA_ENTRYPOINTS
(doc) to force loading the block.
🦜 1
👍 1
j
Now that I saw how this is done, the block needs to be imported from the python file (apparently Prefect doesn't want to run random code in their system, sheesh!) So, the import would just be
import MyCustomBlock
having the python file for that custom block handy. Prefect will store the parameters for the block, but not the block code. SO - suggestion: as a default, this info should probably be on the block screen when a custom block is created...maybe?