在Windows的virtualenv中安装LXML [英] Installing lxml in virtualenv for windows

查看:71
本文介绍了在Windows的virtualenv中安装LXML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用virtualenv,并且想在这个隔离的环境中安装lxml.

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

通常我会使用Windows二进制安装程序,但是我想在此virtualenv中使用lxml(不是全局). Pip安装不适用于lxml,因此我无所适从.

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.

我已经读过创建符号链接可能有用,尽管我不知道符号链接如何工作以及应该为它们创建哪些文件.其他人是否知道在Windows上的virtualenv中安装lxml的任何方法?

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.

推荐答案

最简单的方法是简单地将库复制到您的virtualenv site-packages文件夹中.符号链接是一种使它显示在文件系统上的文件存在但实际上位于其他位置的方法.如果您将库复制过来,它将是真正的隔离.

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.

因此,进入您的全局site-packages文件夹,然后将lxml文件夹和lxml egg文件夹都复制到您的virtualenv网站包中.如果您真的想符号链接(对于NTFS),请在此处.

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.

这篇关于在Windows的virtualenv中安装LXML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆