Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to use a class written in Python 2.x, but get tons of errors in Blender 2.71 Python 3, any ways around this problem?

share|improve this question

There isn't one single way to translate your class from Python 2 to Python 3.

You could try using the command-line tool 2to3 to do the translation, but it's not perfect, so you'll need to verify the results.

share|improve this answer

If it is a pure python class then you can run it through the 2to3 as @Garreth mentioned, this will give you the python-3 equivalent in pure syntax updates.

If the class has any Blender specific code, such as using the old Blender module, this has been replaced with bpy.

If you are creating an add-on, you will need to refactor your code to be registrable as a module. The bl_info, register() & unregister()

You will also have to take into account the various api changes that have occured,

  • animation IPO system replaced with F-Curves
  • BMesh & polygon based geometry system.
  • Interface code is done though bpy types
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.