How to set your PYTHONPATH 101

You try pointing the directory toward python lib in blender setup ? I had trouble with up to version python as well, you might want to try 2.3

thank you al capone,

i just noticed, that i made an error in the path settings %| now blender starts without error mesage. nevertheless i get an error running the fiber script. i will post it in a new threat.

A new threat, you must be very piss at it :smiley: Then yes, you might want to try 2.3 then.

I need help. I just installed Blender 2.35 and Python 2.4 on my XP. I have already set the parameters. But when I ran Blender. the following statement appeared on console

‘import site’ failed; use -v for traceback

What does it suggest? I’m new to Blender and Python… :expressionless: and would really appreciate your help.

Blender 2.3x works with Python 2.3x. Python 2.4 is no good.

Martin

When I start Blender, if I set the Python path correctly, will the Blender DOS screen be empty? Because that is what has happenend after I pathed Python.

Yup, that’s what happens.

Martin

so i cant use python 2.4 with 2.36? all that 10 mb for nothing, yes, 56k is still slow. :<

I think it would help if the people that use Blender heavily realized that some people won’t downgrade their Python for Blender. Like me.

Anyway, I’m new on these boards and came here to find a workaround for Python 2.4. When someone finds it (becuase it’s broke, and it will be fixed somehow) please PM me.

I’d be very happy…

You don’t have to downgrade, you can have 2.4.x and 2.3.x on the same drive.

%<

im on windows ME. i can’t seem to find the enviornment variables tab…

Hallo, I stumbled onto this forum and this thread after trying Blender 2.36 a few weeks ago, uninstalling, waiting a few weeks and going through it all again. I am more determined this time, so I have a question(s).

I read this entire thread, and please correct my assumptions if I am wrong.

-Blender 2.36 will not work with Python 2.4.x, only with 2.3.x

I am downloading Python 2.3.4 now (after incorrectly, I assume, trying the newest version), can I assume that the quoted instructions below will work if I change all the “20’s” to “23’s”?

Thank you kindly and keep up the good work.

Mike

EDIT::: I finally got Python 2.3.4 downloaded and installed (still dial-up here), and for future reference this worked for me. Using Enzoblue’s instructions below all I changed was what I put in the Variable Value Box. I used this for Python 2.3.6 and Blender 2.36:

C:\PYTHON23;C:\PYTHON23\DLLS;C:\PYTHON23\LIB;C:\PYTHON23\LIB\LIB-TK

can anyone spell out clearly for me (because i’m starting to think my brain is mush) setting the python path in mac os10.3? i’ve just upgraded to panther and my terminal reports i have python 2.3 - i also have blender 236. but i still get error meesages saying i don’t have certain modules (like math).

i’ve gone into the file prefs menu in blender and set the path to point to python but still no joy…

best

andy g

I just waded through a whole bunch of garbage to figure out how to make the latest Blender (2.36) work with the Python (2.3) that comes with OS X Panther (10.3).

Firstly, there are two Blender versions for OS X: one for 10.2 and one for 10.3. The Blender for 10.2 will run on 10.3, but it won’t be able to use the Python installed on the system, even though both Blenders are linked against Python 2.3. The difference is that the Blender for 10.3 is built for the “framework” Python that comes with 10.3. The Blender for 10.2 is built for Python installed with Fink:
http://fink.sourceforge.net/

So start by making sure you’re running the right Blender for your version of OS X. The next step is the environment variables. The standard UNIX method of putting them in your ~/.bashrc or /etc/profile or such will only work if you launch Blender from a shell prompt, which makes Blender’s windowing behavior a little strange and is annoying anyway. It won’t work for Mac apps launched from the GUI (from the Dock or double-clicking in the Finder), so you need to use the way Mac passes environment variables to GUI apps.

I used these instructions from Apple (also found earlier in this thread):
http://developer.apple.com/qa/qa2001/qa1067.html

In other words, I created ~/.MacOSX/environment.plist, which is just a XML text file.

I want the Python interpreter embedded in Blender to use the same paths as the system Python, so I get these values by starting Ternimall.App and typing

python

at the prompt. Then I ask Python for its home and path. The session looks like this:


&gt;&gt;&gt; import sys
&gt;&gt;&gt; sys.exec_prefix
'/System/Library/Frameworks/Python.framework/Versions/2.3'
&gt;&gt;&gt; sys.path
['', '/Users/randall', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wx-2.5.3-mac-ansi']
&gt;&gt;&gt; 

So my ~/.MacOSX/environment.plist file looks like this:


&lt;?xml version="1.0" encoding="UTF-8"?&gt; 
&lt;!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"&gt; 
&lt;plist version="0.9"&gt; 
&lt;dict&gt; 
        &lt;key&gt;PYTHONHOME&lt;/key&gt; 
        &lt;string&gt;/System/Library/Frameworks/Python.framework/Versions/2.3&lt;/string&gt; 
        &lt;key&gt;PYTHONPATH&lt;/key&gt;
        &lt;string&gt;.:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages:/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wx-2.5.3-mac-ansi&lt;/string&gt;
&lt;/dict&gt; 
&lt;/plist&gt;

Now Python stuff works like a charm. I know it seems like a lot of work to get it set up, but it’s not bad when you consider that everyone who runs Panther already has Python installed and all they need to do is drop in this exact same environment.plist file to ~/.MacOSX/. It should work for everyone unless they already have one that sets variables for other software.

I don’t know if Fink does anything to set up environment variables for Python. If not, people on OS X 10.2 can use the same technique as above. They just need to use the right values to work with the Fink Python.

badcheese - you’re a star. for a start you reminded me i hadn’t replaces my OS10.2 version with the 10.3 version. so now all the scripts run and i haven’t even done the terminal stuff…

best

andy g

I cant find this user defaults window or whatever - so I can get to the python button…

All I see is a drop down list from the info button that has the following options…
3D View
IPO Curve Editor
NLA Editor
UV Image Editor
Video Sequence Editor
Audio Timeline
Text Editor
User Preferences
Outliner
Button Window
Image Browser
File Browser
Scripts Window

And none of them lead to a Python button…
Were is this mysterious python button located? so I can set the temp fix and show blender were my python lib dir is located??

My Python path is set any ways, but I don’t want to uninstall the latest python v, because I am teaching myself python and need the most current version…

Blender really should be updated in keeping with Python…
But besides that - if I can just set the path to my python lib dir in blender I will be happy with having blender being able to run some of the tutorials…

So can someone tell me exactly what buttons to click to find this PYTHON button?? I mean the proper names of the button on the most current version of blender…

I can see my (i) Info button top left, so were do I go from there??

Thanks in advance…
Hyp

2 ways to get to it; open a User Preferences window from the window-menu icon or drag down the bottom of the header bar at the top of the screen (where that Info button is). Click on “Filepaths” and look for the Python one. To save what you type in there you’ll need to close it all up again and do a Ctrl-U.

%<

I guess you’re looking for this:

Starting position: put your mouse on the (i) Info button
Move your mouse about 10 pixels down, so your cursor changes into a ‘double arrow’ (sorry I don’t know the right name for it)
Drag downwards
You should be able to see some new buttons
Click on the File Paths button
You should see a space where you can type your python path.

I hope that answers your question.

EDIT: Basically the same as what fligh posted just a moment ago, while I was typing this post.

Yup I managed to find it with that advice thanks, but alas it didn’t work heh :frowning:

Guess the only waya round it will be for me to install an earlier version of python on my system as well as 2.4

Hyperion

I am getting very discouraged. When ever i try to run a python script it does not work, besides the unweld script. That one works fine. All the other ones i get an error message. For example with the knife script http://img.photobucket.com/albums/v627/JoshuaDG/sfgb.jpg

     I am using Windows XP, Python 2.3.5 .I did the whole thing where you go into the control panel and under the advanced tab you type pythonpath, then copy and paste in that long thing. I even changed the 20 to 2.3 . I dont know what i am doing wrong. I am aslo wondering whenever you download a script, what file should i put it in. Also what do people mean when they say " Python path".
    Sorry if i have asked questions that have already been answered. I have read this thread but i didnt see what i needed. Please help me. And again sorry if these question have already been answered.