Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing lxml in virtualenv for windows

I've recently started using virtualenv, and would like to install lxml in this isolated environment.

Normally I would use the windows binary installer, but I want to use lxml in this virtualenv (not globally). Pip install does not work for lxml, so I'm at a loss for what I can do.

I've read that creating symlinks may work, although I unfamiliar with how symlinks work and what files I should be creating them for. Does anyone else know of any methods to install lxml in a virtualenv on Windows?

If creating symlinks is the only method that works I'm definitely willing to learn if someone can point me in the right direction.

like image 421
mrl Avatar asked Jul 02 '12 03:07

mrl


2 Answers

  1. Download lxml: http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
  2. Activate virtualenv
  3. easy_install /path/to/the/file/lxml-3.2.1.win32-py3.3.‌exe
like image 56
kros Avatar answered Oct 02 '22 16:10

kros


The easiest way is to simply copy the library into your virtualenv site-packages folder. Symlinking is method of making it appear on the filesystem that the file is there but physically in another location. It would be truly isolated if you copied the library over.

So go into your global site-packages folder and copy over both the lxml folder and lxml egg folder into your virtualenv site-packages. If you really wanted to symlink (for NTFS), look here.

like image 34
chazkii Avatar answered Oct 02 '22 14:10

chazkii