3

I use mysqldb and pydev eclipse. I successfully compiled mysqldb 1.23 and now I would like to import it. mysqldb 1.23 needs the library libmysqlclient.18.dylib which lies in my case in /usr/local/mysql/lib. So when I start my test program in eclipse it crashes since it does not find the correct library. Therefore I need to tell eclipse where to find the libs.

How do I do this my case?

What and where in eclipse/pydev do I have to tell it that libmysqlclient.18.dylib resides in the above directoy?

The error message I get

ImportError: dlopen(/path/to/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /path/to/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so
  Reason: image not found
toom
  • 5,403
  • 5
  • 24
  • 21

2 Answers2

5

In your project's properties, (accessible from Project > Properties...), click the PyDev - PYTHONPATH item. A view of your PYTHONPATH should be visible. Click the External Libraries tab and add your library. The next time you run, it should import correctly.

Chris
  • 3,438
  • 5
  • 25
  • 27
  • Thanks for the hint. I added the path as you said. But I still get the same error message. Is it possible to add the path manually in the run configuration? – toom Jun 17 '11 at 23:19
0

You can add these libraries to the settings to get the effect you want. This can be done in the Libraries setting accessed through Window > Preferences > PyDev > Interpreter - Python > Libraries. Add the .egg or source folder of the libraries you want to add and click Apply followed by OK.

This ansqwer was provided by How to add python "libraries" to Eclypse and pydev

Community
  • 1
  • 1
intotecho
  • 4,925
  • 3
  • 39
  • 54