Is it possible to include a library such as lxml without installing it?

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?

+5
source share
4 answers

Have you tried using virtualenv ? This should allow you to use lxml without "installation."

+4
source

... , , lxml, python .

- "" :

python setup.py install --home=<dir>
+1

python . , lxml c, , .

virtualenv , . lxml , , .

+1

, , , 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
0

All Articles