Running Python Scripts
How to run scripts in Python (and merge AMM deco presets)
Last updated
How to run scripts in Python (and merge AMM deco presets)
Last updated
Published: Dec 14 2023 by Last documented update: Mar 18 2024 by
This guide will teach you how to execute Python scripts under Windows.
This guide is for running files outside of Blender.
If you want to run a Python script in Blender, you need to switch your viewport to the scripting perspective and click "play".
You can find a dedicated guide on Blender: Running Python Scripts in the 3d editing section.
We start by checking if you have Python installed already.
Open a Windows command prompt (Hotkeys: Windows+R
, type cmd
, press enter)
In the window that now opens, type the following:
If you have Python installed, it will now say something like "Python 3.11.3
" . In that case, you can go directly to Step 1: Downloading the script.
Otherwise, please keep reading.
Close the command window - after installing Python, you need to open a new one.
Go to python.org and download the correct installer package for your system - that will usually be Windows installer (64-bit). Take the latest stable release, it will be at the very top of the page.
Now, follow this guide until you have installed Python, or google something like install python on windows for dummies
and follow that guide until you have installed Python.
Proceed to Step 1: Downloading the script
The link in this guide is an example script in case you don't have one. If you do, use that one instead.
Go to mana's github repo and grab the .py script to merge AMM presets:
Download the file by clicking the corresponding button. Save it somewhere where you can find it easily.
Open the script with a text editor of your choice (we recommend Notepad++ under Windows)
Check the top of the file for anything that needs to be adjusted:
Ignore the lines starting with import
Read the lines starting with #
. They are comments and will tell you what to put.
Once you have everything set up, save the script.
Now it is time to run it. Keep reading!
Open a command window again (Hotkey: Windows+R, type cmd
, press enter)
Type python "
(python
, space, quotation mark)
Drag-and-drop the script you downloaded on the console window
Type another quotation mark and hit enter
The quotation marks will prevent error with spaces in path names. Leave them away at own risk :)
That's it - the script will now run and do things
Step the Python version (Step 0: Getting Python, item 1 and 2). As of 2023, the version should start with a 3.
If that isn't it, you made a mistake while editing the script file. Make sure that you don't have single backslashes in strings:
If it's not that, you can use a Python syntax checker, or ask ChatGPT (I'm not kidding). Good luck!
If you are running into this error in Blender, it should be enough to run the program as admin.
Otherwise, you are missing a Python module, and need to install it. You can do that by running the following code from your Windows cmd:
If that does not work, google for something like pip install module your_module_name windows
.