WebFaction
Community site: login faq

Hi,

I'm trying to install this swf creation library called Ming, https://github.com/libming/libming from it's source. After untaring it, I run "./configure --prefix=$HOME -enable--python" and then run "make install". It seems to install fine, but when I do a "import ming" after running python, it gives me an import error. These steps worked for me on my local machine. I was hoping someone could help me out.

Thanks!

asked 27 Apr '11, 23:10

iman453
491527
accept rate: 0%


What is the full trackback?

permanent link

answered 27 Apr '11, 23:37

johns ♦♦
5.3k212
accept rate: 23%

What's a trackback? :S Sorry, I'm new to linux. The configure and make scripts didn't return any error messages, should I provide the entire output? Thanks!

(27 Apr '11, 23:46) iman453

A trackback is the full error stack for that problem. In this case it would be the import error. Also is the 'ming' package on the python path? This python code will print the current paths defined,

import sys
print sys.path

Is there a 'ming' directory in any of those paths?

(27 Apr '11, 23:55) johns ♦♦

The error is: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named ming

Nope, the ming directory/egg isn't in the path. Thanks for your time!

(28 Apr '11, 00:02) iman453

Your welcome.

(28 Apr '11, 00:06) johns ♦♦

Do I have to mention some option while building that would put the ming directory in the sys path every time python runs?

(28 Apr '11, 00:12) iman453

It should have been --prefix=$HOME, as you did. Is there a 'ming' directory there? If you know where the directory is you can move it into ~/lib/python2.X or any other place that is in sys.path.

(28 Apr '11, 00:32) johns ♦♦

Nope, no Ming directory. I tried moving the source directory to one of the directorys in the path, but it didn't seem to work :S

(28 Apr '11, 00:47) iman453

The issue is this is not a native python app, it is a complied binary that has a python wrapper library bundled with it. That python wrapper has its own installer located in /py_ext, you should run python setup.py install form within that directory and see what happens.

(28 Apr '11, 01:05) johns ♦♦

I tried running it, and importing ming after that. I get "Traceback (most recent call last): File "<stdin>", line 1, in <module> File "ming.py", line 2, in <module> import mingc File "mingc.py", line 25, in <module> _mingc = swig_import_helper() File "mingc.py", line 17, in swig_import_helper import _mingc ImportError: libming.so.1: cannot open shared object file: No such file or directory " On my local machine I found the libming.so.1 file in the directory "libming-libming-9b33557/src/.libs/libming.so.1". Should I be copying the file from the source folder somewhere? Thanks for your help

(28 Apr '11, 01:19) iman453

You need to add the directory where your libming.so.1 exists to your LD_LIBRARY_PATH using:

export LD_LIBRARY_PATH=<directory where="" the="" so="" file="" is(full="" path)="">:$LD_LIBRARY_PATH

before starting the python interpreter.

Hope that helps!

(28 Apr '11, 01:26) neeravk

That worked, thanks johns and neeravk :). One last question, I'm building an app using django. How can I ensure that the LD_LIBRARY_PATH is permanently set so Django doesn't face any problems (or is what I have now good enough?)

(28 Apr '11, 01:35) iman453

You can add the export line for LD_LIBRARY_PATH to your ~/webapps/<djangoapp>/apache2/bin/start

Hope that helps!

(28 Apr '11, 02:06) neeravk

my start file already has the following contents: "LD_LIBRARY_PATH=/home/spoll/webapps/django/apache2/lib /home/spoll/webapps/django/apache2/bin/httpd.worker -f /home/spoll/webapps/django/ apache2/conf/httpd.conf -k start". What could I do? Sorry for the bother!

(28 Apr '11, 02:17) iman453

Hi,

You should change it to:

LD_LIBRARY_PATH=(dir containing the .so file):/home/spoll/webapps/django/apache2/lib /home/spoll/webapps/django/apache2/bin/httpd.worker -f /home/spoll/webapps/django/ apache2/conf/httpd.conf -k start

(28 Apr '11, 02:20) neeravk

Worked :) Thanks soo much for your help. I really appreciate it!

(28 Apr '11, 02:27) iman453
showing 5 of 15 show 10 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×102
×44

question asked: 27 Apr '11, 23:10

question was seen: 4,302 times

last updated: 28 Apr '11, 02:27

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM