Rishik Mani
Rishik Mani

Reputation: 498

Command 'blender' not found, despite executing from the installed directory

I am trying to execute a python file using the python from blender. I have downloaded and placed the blender inside my user's home directory. But everytime I try to execute blender command I get the following error:

Command blender not found, but can be installed with:
sudo snap install blender  # version 2.79b, or
sudo apt  install blender
See 'snap info blender' for additional versions.`

My current directory is:

$ pwd /home/rishik/Applications/blender-2.79b-linux-glibc219-x86_64

I executed the following:

blender --background python somepythonfile.py

I do not understand how to invoke python from blender now.

Upvotes: 0

Views: 4054

Answers (1)

Donnie
Donnie

Reputation: 46933

Linux (by default) doesn't put the current working directory in the search PATH. If your blender directory is not in PATH, then you need to specify a full path, even for the current directory:

./blender --background python somepythonfile.py

You can add . to the search path, but this is considered a bad idea due to the possibility of malware impersonating a common command (like ls).

Upvotes: 2

Related Questions