# Blender 2.8 Command Line: Errors on running script

I am looking to run my python scripts using the command line. So far, I have confirmed I can open blender using the command line, and I can open a specific file as well.

The issue comes when I attempt to load a script. I seem to always get the following error:

OSError: Python file "C:\Program Files\Blender Foundation\Blender\genererate_tears.py" could not be opened: No such file or directory


I would imagine I have some missing reference, but I have not been able to find anything where someone else solved this issue.

Here's what my my command line looks like

C:\Program Files\Blender Foundation\Blender>blender -b H:\Blender3d\ScriptingPractice\scriptingpractice.blend -P genererate_tears.py


Essentially:

[Blender.exe] _ [blender file with script] _ [syntax to run python] _ [python script isnide of .blend file]

I have tested the rest of it without the script part, and not running it in the background, so I'm pretty confident it's just the script reference

• Are you sure that it's not just a typo? genererate_tears.py should probably be generate_tears.py, unless the actual file name is misspelled. – Robert Gützkow Nov 21 '19 at 13:54
• I've re-read your question and noticed that apparently you're not storing the script outside of your .blend file, because you say "[python script isnide of .blend file]". In order to for the command to work the script needs to exist at the path given in the error message. If there is no file at the C:\Program File\Blender Foundation\Blender\genererate_tears.py then Blender can't open it. You can store the script wherever you want, but then you need to use an absolute path for the -P flag (it doesn't have to be relative to Blender's install dir). – Robert Gützkow Nov 21 '19 at 14:05
• @RobertGützkow I'm not familiar with storing the path. Would it be appropriate to save my scritp as a text file, and change the .txt to .py? – WillSmithsRobot Nov 21 '19 at 15:18

blender H:\Blender3d\ScriptingPractice\scriptingpractice.blend -P H:\Blender3d\ScriptingPractice\genererate_tears.py