I need to do some xml parsing using a machine on which I may not be able to install libraries. So is it possible to include a python library like lxml with my source code?
Have you tried using virtualenv ? This should allow you to use lxml without "installation."
... , , lxml, python .
- "" :
python setup.py install --home=<dir>
python . , lxml c, , .
virtualenv , . lxml , , .
, , , sys.path.
sys.path
:
path = r'C:\extra_libraries\lxml' import sys sys.path.append(path) import lxml sys.path.pop() # If you want to keep the environment clean