Python, the Scripting Language
Python is a general purpose scripting language and there is a special interface to access all of Blender’s internal functions from that language. Scripts are written in this language that extend the functionality of Blender, without having to re-compile and link the binary distribution. These scripts are written by user-programmers. The recommended version of Python is normally included and installed with the distribution, however you may also download and install it directly from the official Python website, and install it separately. When downloading Python separately, do pay attention to the version number, as the two greatest version numbers will need to match the version numbers that Blender was compiled on, which is displayed in the console window when Blender starts. The supported python version for Blender as of the date for this edit is Python 2.6. Most functions do not rely on Python – a notable exception is the Help menu which opens a web browser pointed to a specific location. Help text is not bundled into Blender, you must download the latest wiki or PDF user manuals, found here or at www.blender.org.
In general, wherever you install Python, you need to establish an operating system environment variable
PYTHONPATH and point it to the Blender Scripts directory where python modules are installed, e.g.
C:\Program Files\Blender Foundation\Blender\scripts\bpymodules for Windows machines. Environment variables on Windows machines are set in the advanced Systems settings, in the Control Panel.
When Blender starts on a machine with Python properly installed, you will get a message in the console window, similar to this one:
Compiled with Python version 2.6.6. Checking for installed Python... got it!
The above messages means that you have installed Python and have the full development and execution environment, and will be able to access, execute and run all Python scripts that are bundled or available for Blender. If you see a different message, such as:
Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] 'import site' failed; use -v for traceback Checking for installed Python... No installed Python found. Only built-in modules are available. Some scripts may not run. Continuing happily.
It just means that the full Python is not available. If you want full Python functionality, refer to the Python site for installation instructions.
When you install Blender, you must tell the Python module where you put the scripts. If you choose to put user data in a different location for each user, then the install will put your scripts in the
C:\Users\<Current User>\AppData\Roaming\Blender Foundation\Blender\.blender\scripts folder. If you are upgrading, you probably want to overwrite all your old scripts with the new versions, and not have several versions of the same script hanging around on your PC. The best place, if you will not be editing them, is to put them in your Program Files folder with Blender:
- Do a search on your machine for a file name with the word “scripts”.
- You will see the scripts folder appear after the initial search:
C:\Program Files\Blender-2.49\.blender\scripts, or something similar…
- Open the script folder from the search window. You will see all the scripts. You can leave them there, or put them on your desktop temporarily…
- Then go to
Program Files, then to
Blender Foundation, then
blenderfolder, then make inside it a new folder called
- Drag and drop or copy all the scripts from where ever you put them into this folder.
- Make sure to include the two module folders in the script one.
- Then, if you don’t know this already, open Blender.
- In Blender, the top menu bar hides all the preferences. Drag it down and then you will see a button marked File Paths.
- Once you click that File Paths button, a set of path fields will be revealed.
- Go to the Python Scripts one and type in the script folder path you just created (or use the “folder” button to open a file browser – and hit the SELECT SCRIPT PATH button to validate).
- Then go to the File menu and Save Default Settings (CtrlU), so that Blender will remember that the script folder is where you told it to look!
- Be careful though if you have already done stuff in Blender at this point, every time you start it it will be the default start up…