4

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?

Lordi Lordi
  • 41
  • 1
  • 3

4 Answers4

4

Usually a symlink is created in your path called python3.

So you should just need to call your program via

python3 ProgramName.py
Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
1

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
Shaurya Uppal
  • 3,410
  • 31
  • 31
0

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.

Carl Staelin
  • 1,067
  • 10
  • 9
0

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.

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251