473,506 Members | 14,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where does Python look for libraries?

ACB
I have been trying to get the gdmodule installed and have run into an issue.
When I import gd I get the following error.
import gd

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/gd.py", line 10, in ?
import _gd
ImportError: /usr/local/lib/libgd.so.2: Undefined symbol "libiconv_open"

But, when I run
nm libiconv.so
in the directory with the iconv library I get an entry like this
00011fe0 T libiconv_open

so I know the functionality is there. So, my question. Does python have a
way to add search directories for locating libraries?

Thanks.
Mar 27 '06 #1
2 2242
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Python has sys.path
If you want to add dirs into your PYTHONPATH add them to sys.path
Jesus Rivero - (Neurogeek)

ACB wrote:
I have been trying to get the gdmodule installed and have run into
an issue. When I import gd I get the following error.
import gd


Traceback (most recent call last): File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/gd.py", line 10, in ?
import _gd ImportError: /usr/local/lib/libgd.so.2: Undefined symbol
"libiconv_open"

But, when I run nm libiconv.so in the directory with the iconv
library I get an entry like this 00011fe0 T libiconv_open

so I know the functionality is there. So, my question. Does
python have a way to add search directories for locating libraries?
Thanks.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEKFHNdIssYB9vBoMRAli3AJ9dFHXpXnrKCWiiSZZhue dKvZnQXgCeLeQF
QbRIUt2RC//D+RMrWFsg8lY=
=S8Ke
-----END PGP SIGNATURE-----

Mar 27 '06 #2
Jesus Rivero - (Neurogeek) wrote:
Python has sys.path
If you want to add dirs into your PYTHONPATH add them to sys.path
The OP seems to be asking about C libraries dynamically linked to extension
modules, not Python libraries.
ACB wrote:
I have been trying to get the gdmodule installed and have run into
an issue. When I import gd I get the following error.
>>import gd

Traceback (most recent call last): File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/gd.py", line 10, in ?
import _gd ImportError: /usr/local/lib/libgd.so.2: Undefined symbol
"libiconv_open"

But, when I run nm libiconv.so in the directory with the iconv
library I get an entry like this 00011fe0 T libiconv_open

so I know the functionality is there. So, my question. Does
python have a way to add search directories for locating libraries?


No. You will have to read your OS's documentation on how to make sure
libiconv.so is in a location your dynamic linker will look for shared libraries.
If you are on Linux, then probably

$ man ld.so

will tell you the appropriate information.

--
Robert Kern
ro*********@gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Mar 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
4292
by: Michael Tobis | last post by:
Someone asked me to write a brief essay regarding the value-add proposition for Python in the Fortran community. Slightly modified to remove a few climatology-related specifics, here it is. I...
23
2359
by: gord | last post by:
As a complete novice in the study of Python, I am asking myself where this language is superior or better suited than others. For example, all I see in the tutorials are lots of examples of list...
852
27941
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
12
5159
by: Ben Sizer | last post by:
Although the standard library in Python is great, there are undoubtedly some great packages available from 3rd parties, and I've encountered a few almost by accident. However, I don't know how a...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.