Blender cannot import/find ayon_core

Hi,

Im setting up AYON for myself at the time being, but have struck a little problem Im not sure im doing all the right steps.

Server and launchers are all up to date and running fine (as of today) but when launching blender I cannot get it to find/load ayon_core at startup.

Ive installed Pyside2 and get no other errors than:

Traceback (most recent call last):
  File "/opt/blender/4.3/scripts/modules/bpy/utils/__init__.py", line 140, in _test_import
    mod = __import__(module_name)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/johndoe/.local/share/AYON/addons/blender_0.2.1/ayon_blender/blender_addon/startup/init.py", line 1, in <module>
    from ayon_core.pipeline import install_host
ModuleNotFoundError: No module named 'ayon_core'

Do have to explicitly tell when launching blender that it should launch with the AYON addin in mind? Or does tha launcher automatically know this?

Sorry for the noob questions, but any pointers would be appreciated!

1 Like
  1. Are you launching Blender via the AYON launcher? If not - that’s part of your issue.

  1. What does your active bundle look like?

In the AYON web frontend go to the bundles page (shortcut is B+B)

Make sure it includes core. That is the AYON core addon.

If you want to use a decent recent “bundle”, trigger “Update pipeline” top right for your server from the AYON web frontend.

image

That’ll create a new bundle with up-to-date addons (including a recent AYON launcher and required dependencies package).

1 Like

Thanks Roy for answering.

Im using the Launcher to start blender, I have updated the bundles to include the latest version of core and made sure the launcher is running the latest version still.

But i still keep getting “ayon_core” not found from looking at the terminal logs.

Its like Im missing some crucial step? How does blender get launched to include ayon_core?

Also,

I’ve removed the .local/AYON folder just to see if there were any vestigial files that caused issues but made no difference.

Ah - I know what it is!

You likely added your own Blender version variant to the application settings?

You are most likely facing a a Blender “feature” where it doesn’t include PYTHONPATH passed along to it by default.

In the application settings, for your variant - expand the Arguments section.
In there add:

--python-use-system-env

As a comparison you can check the argument sections of any default pre-defined application variants for blender. Without that argument, Blender will force exclude everything from PYTHONPATH from its sys.path and hence does not include any external python libraries.