BLender could not be launched although it is in the PATH and working

My unity version is 2018.4.24
blender is 2.82
system is Ubuntu 18.04

I was given a project with assets in .blend format. I am a unity newbie but I was told I should run “Reimport all” on my models to create the files for unity, which will launch blender in the background.

This fails and the log says
Blender could not be launched. Make sure that Blender is installed correctly and in your PATH

But I can launch blender in a terminal by just typing “blender” and “which blender” also gives the correct path to blender, so it is in my PATH (I put it in my bashrc).
What’s more, when I click on the line in the unity log with the Blender error, blender actually launches correctly and the model is displayed fie in blender.

I am at a loss now as to where to look for the reason for this problem. Any hints?
Thanks a lot!

Running Unity 2020.1.0f1 and 2019.4.1f1
Blender 2.83.3
Pop!_OS 20.04 LTS

Blender and Unity was working fine for months for me. However problems started after installing Unity Hub as a flatpak from flathub and opening my project through Unity Hub. Blender, Visual Studio Code and custom some editor scripts that start external processes where no longer working from within the editor.

Blender is in $PATH, as you can see blender is in path via a symbolic link.

It appears environment variables are being reset/changed/lost when launching the editor through the unity hub flatpak.

I have resolved this issue by not using unity hub and launching the editor directly without the flatpak’s sandbox.

Using the code below you can see the PATH that unity is actually getting.
Debug.Log(Environment.GetEnvironmentVariable("PATH"));

While running the editor through Unity Hub PATH was: /app/bin:/app/bin:/usr/bin
While running the editor without going through Unity Hub PATH was: /home/tom/.cargo/bin:/usr/local/cuda/bin:/home/tom/.local/bin:/home/tom/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/tom/.dotnet/tools:/usr/lib/cuda/bin

Make sure you install unity hub as an appimage from unity’s website. Looks like the unofficial flatpak from flathub was my problem.

As you can see in this screenshot of the page on flathub, The page says: This wrapper is not verified by, affiliated with, or supported by Unity Technologies.

I had success with deleting blender off the system then reloading blender.I then checked the blender file which was giving me problems, for some reason the blender file was saved with a .blend1 after the file name sos I deleted the 1 and reimported the file and it worked :slight_smile: