libopenshot and Python

The library that powers Openshot 2.0

Moderators: Andy, Cenwen, beats

libopenshot and Python

Postby drdec » Sun Mar 08, 2015 4:09 pm

I'm a professional software developer, but I don't regularly use Python, although I have played around with it. I would like to use the Python bindings for libopenshot to create some scripts, but I'm not sure how to get my environment set up so that the Python bindings for libopenshot are recognized. Any tips would be appreciated.
drdec
New member
 
Posts: 9
Joined: Mon Sep 10, 2012 4:14 pm

Re: libopenshot and Python [import problem SOLVED]

Postby ticomse » Wed Feb 03, 2016 12:06 am

When I installed libopenshot, I ran into a problem importing openshot into Python.

This error was the symptom:

>>> import openshot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "openshot.py", line 28, in <module>
_openshot = swig_import_helper()
File "openshot.py", line 24, in swig_import_helper
_mod = imp.load_module('_openshot.so', fp, pathname, description)
ImportError: dynamic module does not define init function (initso)


The problem was that I had two versions of python installed. Python3 was needed, but the system was calling an older version.
For example, here is an ls of /usr/bin/python*

lrwxrwxrwx 1 root root 9 Aug 8 14:55 /usr/bin/python -> python2.7
-rwxr-xr-x 1 root root 3345416 Jun 22 2015 /usr/bin/python2.7
lrwxrwxrwx 1 root root 9 Aug 8 14:55 /usr/bin/python3 -> python3.4
-rwxr-xr-x 2 root root 3709944 Oct 14 17:42 /usr/bin/python3.4

Note that /usr/bin/python is linked to python2.7

To fix this problem, link python to python 3.4 like this:
sudo ln -s /usr/bin/python3.4 /usr/bin/python

Good luck!
ticomse
New member
 
Posts: 1
Joined: Tue Feb 02, 2016 11:58 pm


Return to libopenshot

Who is online

Users browsing this forum: No registered users