I use ubuntu 10.10, and I have both Python 2.x and Python 3.x. I have a program that needs to run with python 3.x (blender 2.5x).
How do I run a program with python 3.x?

- 41
- 1
- 3
-
1Belongs on http://www.superuser.com – YasirA Mar 20 '11 at 14:26
-
not sure if "through" == "with" in your question. – gideon Mar 20 '11 at 14:27
-
1@Yasir feels like it but its a programing config-ish question – gideon Mar 20 '11 at 14:27
-
@giddy Before editing there were some french words in the question, so I think he's not a native english speaker and had it translated via software. – Federico klez Culloca Mar 20 '11 at 14:28
-
@Lordi Lordi: And when it get's migrated to superuser.com, remember to add the error message. Otherwise people have to just guess wildly. – Lennart Regebro Mar 20 '11 at 15:48
4 Answers
Usually a symlink is created in your path called python3
.
So you should just need to call your program via
python3 ProgramName.py

- 26,308
- 17
- 56
- 95
Installation
sudo apt-get install python3
Even after installing python3, python 2.7 will stay and be default
Now, the way to run python3 code->
Method 1
Run python3
Now write the code
Method2
Run a save sample.py file
python3 sample.py

- 3,410
- 31
- 31
Do you have a separate python executable for python 2.x and for python 3.x? On my system I have /usr/bin/python2.5 and /usr/bin/python2.6. I also have a /usr/bin/python2, which is a symbolic link to /usr/bin/python2.6. I presume that you have a /usr/bin/python3 too. In which case, you simply run the program using /usr/bin/python3 instead of the more generic /usr/bin/python.
I hope this helps.

- 1,067
- 10
- 9
Blender is not run with or through Python at all. It's a native compiled executable and runs directly. It does however embed Python and use it as a scripting language. Blender 2.5 uses Python 3, and for this to work you need Python 3 installed on your system in the path, so blender can find it.
That's all, afaik.

- 167,292
- 41
- 224
- 251