I have installed lxml which was built using a standalone version of libxml2. Reason for this was that the lxml needed a later version of libxml2 than what was currently installed.
When I use the lxml module how do I tell it (python) where to find the correct version of the libxml2 shared library?
Set the environment variable PYTHONPATH to a colon-separated list of directories to search for imported modules. In your program, use sys. path. append('/path/to/search') to add the names of directories you want Python to search for imported modules.
To make sure Python can always find the module.py , you need to: Place module.py in the folder where the program will execute. Include the folder that contains the module.py in the PYTHONPATH environment variable. Or you can place the module.py in one of the folders included in the PYTHONPATH variable.
For most Linux environments, Python is installed under /usr/local , and the libraries can be found there. For Mac OS, the home directory is under /Library/Frameworks/Python. framework . PYTHONPATH is used to add directories to the path.
In the System variables section, selecting the Path variable and clicking on Edit. The next screen will show all the directories that are currently a part of the PATH variable. Clicking on New and entering Python's install directory.
Assuming you're talking about a .so
file, it's not up to Python to find it -- it's up to the operating system's dynamic library loaded. For Linux, for example, LD_LIBRARY_PATH
is the environment variable you need to set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With