Can't run

Asked by Henna Haahti

That's it. When I run

$ python OpenShot.py

it says:

Traceback (most recent call last):
  File "OpenShot.py", line 21, in <module>
    import windows.MainGTK as MainGTK
  File "/home/hohoo/openshot/main/windows/MainGTK.py", line 26, in <module>
    import classes.project
  File "/home/hohoo/openshot/main/classes/project.py", line 20, in <module>
    import thumbnail as thumbnail
  File "/home/hohoo/openshot/main/classes/thumbnail.py", line 19, in <module>
    import mltpp
ImportError: No module named mltpp

Question information

Language:
English Edit question
Status:
Solved
For:
OpenShot Video Editor Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jonathan Thomas (jonoomph) said :
#1

It looks like you don't have the MLT framework installed. You will need to manually compile MLT and generate the Python bindings for MLT. There are instructions on MLT's website on how to generate the Python bindings: http://www.mltframework.org/twiki/bin/view/MLT/. It's kind of a pain right now. Hopefully as I approach a release, I can simplify this process.

Revision history for this message
Henna Haahti (grejppi) said :
#2

Do I have to use SWIG or something? The page you linked to is not informative at all.

Revision history for this message
Jonathan Thomas (jonoomph) said :
#3

Yes, you have to use SWIG to generate the Python bindings.

1) Here are the instructions for installing MLT
http://www.mltframework.org/twiki/bin/view/MLT/Install

2) Download the mlt source code and mlt++ source code
https://sourceforge.net/project/showfiles.php?group_id=96039

3) Inside the MLT++/swig/ folder are scripts to generate the Python bindings

4) Copy the new Python bindings into your "site packages" folder

To verify everything works, open up a Python shell, and type:
import mltpp

If it doesn't give you an error then OpenShot should work.

Thanks,
Jonathan

Revision history for this message
Henna Haahti (grejppi) said :
#4

Now it's saying:

ImportError: No module named _mltpp

Revision history for this message
Jonathan Thomas (jonoomph) said :
#5

When you generate the Python bindings for MLT, it creates 2 files that need to be added to your /site-packages/ folder:

1) mltpp.py
2) _mltpp.so

Double check that both files are in your /site-packages/ folder, and let's see if that fixes your error. Of course, after you do this, be sure to launch a new Python console... so it sees the new /site-packages/ files.

Good luck! =)

Revision history for this message
Henna Haahti (grejppi) said :
#6

I tried compiling MLT with the guide in the README file. But "sudo make clean" is saying something weird:

hohoo@dell:~/mlt_trunk/mlt$ sudo make clean
list='src/framework src/inigo src/valerie src/miracle src/humperdink src/albino src/modules profiles'; \
 for subdir in $list; do \
  make -s -C $subdir depend || exit 1; \
  make -C $subdir clean || exit 1; \
 done
make[1]: Siirrytään hakemistoon "/home/hohoo/mlt_trunk/mlt/src/framework"
rm -f mlt_frame.o mlt_geometry.o mlt_deque.o mlt_property.o mlt_properties.o mlt_events.o mlt_parser.o mlt_service.o mlt_producer.o mlt_multitrack.o mlt_playlist.o mlt_consumer.o mlt_filter.o mlt_transition.o mlt_field.o mlt_tractor.o mlt_factory.o mlt_repository.o mlt_pool.o mlt_tokeniser.o mlt_profile.o mlt_log.o mlt_cache.o libmlt.so.0.3.9 libmlt.so
make[1]: Poistutaan hakemistosta "/home/hohoo/mlt_trunk/mlt/src/framework"
make[1]: Siirrytään hakemistoon "/home/hohoo/mlt_trunk/mlt/src/inigo"
rm -f inigo.o io.o inigo
make[1]: Poistutaan hakemistosta "/home/hohoo/mlt_trunk/mlt/src/inigo"
make[1]: Siirrytään hakemistoon "/home/hohoo/mlt_trunk/mlt/src/valerie"
rm -f valerie.o valerie_notifier.o valerie_parser.o valerie_response.o valerie_status.o valerie_tokeniser.o valerie_util.o valerie_remote.o valerie_socket.o libvalerie.so.0.3.9 libvalerie.so
make[1]: Poistutaan hakemistosta "/home/hohoo/mlt_trunk/mlt/src/valerie"
make[1]: Siirrytään hakemistoon "/home/hohoo/mlt_trunk/mlt/src/miracle"
rm -f miracle.o miracle_log.o miracle_server.o miracle_connection.o miracle_local.o miracle_unit.o miracle_commands.o miracle_unit_commands.o miracle libmiracle.so libmiracle.so.0.3.9
make[1]: Poistutaan hakemistosta "/home/hohoo/mlt_trunk/mlt/src/miracle"
make[1]: Siirrytään hakemistoon "/home/hohoo/mlt_trunk/mlt/src/humperdink"
rm -f client.o io.o remote.o humperdink
make[1]: Poistutaan hakemistosta "/home/hohoo/mlt_trunk/mlt/src/humperdink"
make[1]: Siirrytään hakemistoon "/home/hohoo/mlt_trunk/mlt/src/albino"
rm -f albino.o albino
make[1]: Poistutaan hakemistosta "/home/hohoo/mlt_trunk/mlt/src/albino"
filter_sox.c:40:44: error: missing binary operator before token "("
filter_sox.c:46:44: error: missing binary operator before token "("
filter_sox.c:82:43: error: missing binary operator before token "("
filter_sox.c:108:43: error: missing binary operator before token "("
filter_sox.c:138:43: error: missing binary operator before token "("
filter_sox.c:255:43: error: missing binary operator before token "("
filter_sox.c:305:43: error: missing binary operator before token "("
filter_sox.c:312:43: error: missing binary operator before token "("
filter_sox.c:418:43: error: missing binary operator before token "("
make[2]: *** [depend] Virhe 1
make[1]: *** [depend] Virhe 1
make: *** [clean] Virhe 1
hohoo@dell:~/mlt_trunk/mlt$

("Virhe" means "Error")

Revision history for this message
Jonathan Thomas (jonoomph) said :
#7

You might try disabling sox, and see if it will compile. Just add --disable-sox to the ./configure command.

Revision history for this message
Henna Haahti (grejppi) said :
#8

Now make clean works, but make says:
/usr/bin/ld: cannot find -lbz2

Revision history for this message
Jonathan Thomas (jonoomph) said :
#9

Try installing the bzip2 package. If you are using Ubuntu, I think this is the command to install it:
sudo apt-get install libbz2

Otherwise, look around your package manager for the bzip2 package. Good luck.

Revision history for this message
Henna Haahti (grejppi) said :
#10

Got that working but now what is this supposed to say?

$ ./configure python
Configuring python ... [: 42: 1: unexpected operator
[: 42: 1: unexpected operator

$

Revision history for this message
Jonathan Thomas (jonoomph) said :
#11

Not sure about this one. Are you typing the "./configure python" command? Or is MLT trying to run that command during the build process?

Also, I'm not sure if you have read the updated README for OpenShot, but I just recently added instructions for installing MLT. You might have a look: http://bazaar.launchpad.net/~openshot.developers/openshot/main/annotate/head%3A/main/README.txt.

Revision history for this message
Henna Haahti (grejppi) said :
#12

I'm doing it just like the README says.

Revision history for this message
Jonathan Thomas (jonoomph) said :
#13

I would be sure you have the Python-dev package installed. Other than that, if it still gives you an error, I would suggest emailing the MLT mailing list. I've installed MLT 4 or 5 times now, but I'm no expert on MLT by any means. Good luck!

Revision history for this message
lhz (m-lhaza) said :
#14

I got the same errors on a freshly insted jaunty (ubuntu 9.04).
however the swig-process successfully creates all the necessary files. Just ls -l the python directory...

I just copied over goocanvas-libs from /usr/local/lib/PYTHON/site-packages to /usr/lib/python2.5/site-packages

However, when I try to load a mts-movie (generated by dvgrab from my canon hv20) I got:

user@host:~/Openshot$ python2.5 openshot/main/OpenShot.py
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/home/m/Openshot/openshot/main/classes/thumbnail.py", line 119, in run
    mltpp.Factory().init()
NotImplementedError: Wrong number of arguments for overloaded function 'Factory_init'.
  Possible C/C++ prototypes are:
    init(char const *)
    Mlt::Factory::init()

/home/user/Openshot/openshot/main/windows/SimpleGladeApp.py:337: GtkWarning: gtk_toolbar_set_icon_size: assertion `icon_size != GTK_ICON_SIZE_INVALID' failed
  return gtk.glade.XML(self.glade_path, root, domain)
A new frmMain has been created
on_mnuImportFiles_activate called with self.mnuImportFiles
Failed to import file: /media/disk/cam/eggs/dvgrab-001.m2t
on_mnuImportFiles_activate called with self.mnuImportFiles
on_mnuImportFiles_activate called with self.mnuImportFiles
on_mnuImportFiles_activate called with self.mnuImportFiles
on_mnuQuit1_activate called with self.mnuQuit

however the GUI shows up and looks nice (but since I only got m2t...)

Revision history for this message
Jonathan Thomas (jonoomph) said :
#15

I would make sure that your MLT installation is correct. First, I would make sure FFMPEG is working. Try using the "ffplay" command to watch a local video file. If that works, then I would try the demos that come with MLT? I think they are located in the ~/mlt_trunk/mlt/demo/. For these demos to work, you have to add some movie clips to that folder, just take a look at the README in the demo folder. If those demos work, then I would check the "play_w.py" python file that is in the ~/mlt_trunk/mlt++/swig/python/ folder. If that works, then OpenShot will work. Hope that helps.

I just setup MLT on a new 9.04 Ubuntu install, and I had to build MLT a few times... until I got the ./configure will the correct options. Each time I tested MLT with the demos in the /mlt/demo/ folder. Finally the demos worked, and I knew I had installed it correctly.

Revision history for this message
Jonathan Thomas (jonoomph) said :
#16

Just as a follow-up, there is now a build wizard available for download. It will help install all of the dependencies, and hopefully fix the problems mentioned above. Hopefully...

https://launchpad.net/openshot/+download

Revision history for this message
Jonathan Thomas (jonoomph) said :
#17

These errors are solved by the new build wizard.