Installing new Python version

Hi guys,
I just installed Python 2.3.4 on my Mandrake 9.0 Linux system to use with Blender 2.33. The problem is that I had 2.2.1 there already and I forgot to uninstall that one first (also I don’t know how to uninstall or even if I should, remember I’m still a Linux newbie). The problem is that when I start the Python interpreter I still get version 2.2.1. So what do I do to clean up my mess?

Thanks,
Hans Petter

Ok, I found out that as soon as I started Python as my own user I was able to start Python 2.3.4. But still everything is not all right. I think my pytonpath is ok, but I get this in the console when I start Blender:


Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
warning: Python C API version mismatch for module strop: This Python has API version 1012, module strop has version 1011.
'import site' failed; use -v for traceback

Anybody knows what that means?

Hans Petter

I think you should install Python 2.3.3 instead of Python 2.3.4

I have Fedora Core 1 which comes with Python 2.2.3 and when I installed blender 2.33, starting blender gave the same kind of error, also complaining about a version mismatch. After installing version 2.3.3, that error disappeared.

Hope this helps,

Wim

Well, as far as I could see, 2.3.4 was the only one available at python.org, but I’ll take a closer look.

Btw, how do I uninstall 2.3.4? I buildt it from sources and this is Mandrake Linux 9.0.

Hans Petter

Python 2.3.3 can be found here: http://www.python.org/2.3.3/

I dont know directly how to uninstall something build from source (other than become root and manually deleting the files)
Best thing you can do is try to find a binary rpm for you distro or else download the source rpm from the above url and rebuild it for your distro, some info about rebuilding from source rpm can be found here.

Greetings,

Wim

You had FC1 with Python 2.2.x.

You installed Blender 2.33 which needs Python 2.3.x.

Yes, I know, I have read this Thats what I wrote in my first post…
Where I say “version 2.3.3” I mean Python and “2.33” refers to Blender.

Thanks a lot, I’ll look into this tonight.

Hans Petter

Well, after deleting the python 2.3.4 directory and installing 2.3.3 from source rpm’s I still get this version mismatch warning when running Python as my own user:


warning: Python C API version mismatch for module strop: This Python has API version 1012, module strop has version 1011.
'import site' failed; use -v for traceback 

Have I overlooked something when I cleaned out 2.3.4? Does it matter? Since I get the “‘import site’” failed message I guess something is wrong with my python path, which is as follows:


['', '/usr/lib/python2.2', '/usr/lib/python2.2/lib-dynload', '/usr/lib/python2.2/site-packages', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload']

Is there anything obvious missing there? I can’t think of anything.

I just want this to work [!]

:x Hans Petter

Your PythonPath still points to Python 2.2.X. If you remove that, it should already work better.

Martin

Right. Thanks, Martin.

HP

u can have different versions of python living happyly together on the same machine:
I´ve 3 div. python versions
2.01 for old stuff with the creator/publisher
2.2.2 for scripts up to 2.32
2.3.3 for rock´n roll

on rh (it should be the same on any lin*x) get rid of the original python instalation completely
install from source to where ever u want it
fire up (execute) the python version and the blender version that goes with it from another terminal ( I split mine in 2) u must start blender from a terminal, not by clickin´
write 1st in python:

import sys
print sys.path

u get python to print the pythonpath with return

write the same in a blender text-window and press alt p

u should see the python path in the blender-terminal

then just enter the path in the set-up (I) window in blender

u repeat that with the other versions…done :wink:


on windblows u can do the same----open both python and blender and do as above. u see the path in the dos-window

Ok, now My pythonpath points to 2.3.3 only and there is no complaint about version mismatch in module strop, but I still get this:


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
sys_init:warning - no sitedirs added from site module.

And I don’t understand it. what is $PYTHONHOME and what is <prefix> and <exec_prefix>?

Hans Petter

I had major problems with the Pythonpath after switching from Windows to Linux. But after a bit of help from Surphaze on irc I found out that I had to add the following to /etc/profile:


PYTHONPATH=/usr/local/lib/python2.3:/usr/local/lib/python2.3/plat-linux2:/usr/local/lib/python2.3/lib-tk:/usr/local/lib/python2.3/lib-dynload
PYTHONHOME=/usr/local/lib/python2.3

export PYTHONPATH
export PYTHONHOME

This is on Mandrake 9.0.

This has never been mentioned by anyone in this thread, and it is not in the manual, where it definitely should be.

Now I have to say that I start Blender from a desktop icon, not from the command line. If I had done so it would be enough to have this in my user’s bash_profile.

Now I can finally use that bevel script! :smiley:

All the best,
Hans Petter

Well, it wasn’t all that well after all. After I changed my /etc/profile I logged out and restarted the X-server. Then it worked. But the next time I did a normal startup of the machine there was again no pythonpath. Well, I logged out and restarted X again, problem solved.
I have added the pythonpath to my user’s .bashrc, so I can start Blender from the command line with the pythonpath set, but not from my desktop shortcut, which I really want to do. So what do I try next? Is there something I can add to my desktop shortcut’s properties to force the pythonpath to get set?

This is with Mandrake 9.0 and KDE 3.0.

Hans Petter (quite frustrated now!)