Blender has its own Python app. Think of it as a Python interpretor. Some scripts though need to use more than is available in Blender. They need Python installed. Then Blender, and the script, need to know where to find Python on your HDD, it needs to know the path to python. So you ‘set the Python Path’. It’s the same as would have been done in the old windows 3.1 where you added that path to autoexec.bat.
So, no, Python doesn’t have to be open. Once, and if you have set your Python path correctly, any Python script will know where to find it.
Is Python supposed to be running when Blender is? Or how do I get these scripts to work now?
Load the script(s) into the text window, put your mouse in that window and hit ALT-P. If nothing happens look in the console window (DOS) behind Blender and see the report. If you can’t work out the problem ask in the forum and give the script, Blender version, Python version, OS and a copy of the error report.
Some scripts need a dll (so) and /or a module to be in your home (Blender) file.
You can also use the ‘short path’ when setting an environment variable in windows.
The short path is simply this:
-if your directory name runs over 8 letters you type the first 6 letters and then add ~1 to the path (~2 if the there are more than one directory with the same first 6 letters and you want the second one).
-you should capitalize the first 6 letters
-remove any periods from directory names and make them into underscores
C:\Program Files\My Python Install\Python 22
I had Python working with Blender 2.28 in Mac OS X.2.6, but now that I’ve upgraded to Jaguar (X.3.1) I can’t get any scripts to work at all. X.3 comes with Python 2.3 installed, and I have tried everything I can think of to get things working…but they haven’t. Python launches fine from the terminal, but I just can’t get Blender scripts to run.
I’d appreciate any help. I have tried using the paths listed by sys.path in the terminal, but those still don’t work.
OK…here’s what I did that got Blender 2.28 and Python working again in Panther. I installed Jaguar onto another drive and linked the Python script path to the /usr/lib/python2.2/ directory on the Jaguar installation. It’s an ugly solution, but it give the same function that I had before the Panther upgrade.
I tried every possible solution I could think of, including installations of earlier versions of MacPython (2.2.2, 2.2.3) but those didn’t work. I have searched for other Python installations for OS X but haven’t found anything else.
Panther doesn’t use the same Python configuration, instead it uses /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/, and because the OS actually uses Python 2.3 for some functions it can’t be removed or changed without serious problems. Setting this Python path in Blender doesn’t work at all, only the Jaguar installation of 2.2 works. As I understand it, Blender just doesn’t work with Python 2.3?
Unfortunately the default Jaguar installation of Python doesn’t run well with all Blender scripts, but it does work with some. Make Human 149 works, but 150 can’t even get past “import ToEvaluate” in the first few lines (can’t figure out why it’s doing that, everything appears in order).
I’d love to hear how to get Blender and Python running as well in OS X, either Jaguar or Panther, as they apparently do with other systems. If anyone has a better solution than what I’ve done, I’d really appreciate it. There are a lot of great Blender scripts that I wasn’t able to use in Jaguar, and that means they don’t work with this extreme multi-OS-installation solution either…
I have been able to get many Python scripts to work with Blender 2.8 and Panther by saving them as .py (Python) text files and copying them directly into the Blender package along with all of the Jaguar Python 2.2 library. The Jaguar Python 2.2 library is found in /usr/lib/python2.2/. Show contents for the Blender app and copy the scripts and library into the MacOS directory in the package. Bingo, it works…at least as well as it did in Jaguar. There is also no need to set the Python path in user settings.
you dont need to set the python path in blender for mac os x
heres how you set up python for blender 3.X and python.
install python 2.2.3 binary
this will set the python path.
blender was built on the fink instalation of python.
the autoexec.bat is just in front of you, yes,yes
in the C:/ directory (normally)
But probably it’s hiden
Set “show system or all files???” in the file property??? menu ( not sure about the names).
I’m new to Elysium and this is my first post. I’ve been using Blender for a while now (mainly for it’s modelling capabilities), but I’ve never used the Python features before but I wanted to give it a try. I’m having some trouble although. Here’s what I’ve done so far.
-Installed Python 2.2.3
-added the commandline in the autoexec.tsh file
-restarted my computer
I’m using windows98 with Norton Antivirus installed which copied and changed my autoexec file extention to .tsh. When I opened the original autoexec.bat file this is what I saw;
@C:\PROGRA~1\NORTON~1\NAVDX.EXE /Startup @ECHO OFF
rem *** DO NOT EDIT THIS FILE! ***
rem This file was created by the System Configuration Utility as
rem a placeholder for your AUTOEXEC.BAT file. Your actual
rem AUTOEXEC.BAT file has been saved under the name AUTOEXEC.TSH.
So…I added the commandline to the new TSH file, but Python isn’t working.
I looked for the Python button in the Blender2.31a User Preferences but I didn’t see it. At this point I’m lost. I feel like I’m just overlooking something. Can anyone give me a hand?
I’ll fiddle with it more tonight. I’m gonna be on the road working till Christmas day but I’ll check in then.
By the way, The “DO NOT EDIT THIS FILE” message was in the New autoexec.bat file… I modified the original .bat that is now a .tsh file thanks to Norton. I still had no luck with getting Python working. Maybe that’s the problem…
I managed to get Python working by adding the Python path directly in the Blender User Preferences. I didn’t find the place to write the path at first because there was a path already assigned and I didn’t realize it was wrong…duh %|
Now my new issue is figuring out which scripts will run in 2.31. Lsystem doesn’t work. I may have to stick with 2.28 if I want to use it. :-?
As far a getting some quick help, maybe you could go to the chatbox and get some one on one.