简体   繁体   中英

install precompiled packages into python3 virtualenv

I am working on an application in Python 3.3 on Win7 x64. When installing lxml with pip

pip install lxml

i always get the following error:

lxml error: Unable to find vcvarsall.bat

This question has been answered on SO before, but the solutions usually point to executables (as it occurs due to compiler problems). However, I want to install lxml into a virtualenv:

> cd \venv\Scripts
> activate
(venv) > pip install lxml

Obviously this get me the same vcvarsall.bat error as before; clearly I still don't have the right compiler installed.

How do I install a precompiled executable ( like these ) into a virtualenv?

Thanks.

I have found a workaround, however I'm unsure whether this is a clean or even sane way of doing it.

As the vcvarsall.bat error occurs due to a misconfigured or wrong compiler, use a precompiled package from the source in the question. If you install that package into the system python installation, it will put the scripts into

C:\Python33\Lib\site-packages

after installation, there should be two folders: lxml and lxml-3.2.3-py3.3.egg-info . By copying both folders into the respective folder of the virtualenv , the package should be available there as well. For example if the virtualenv is in C:\\venv\\ , copy the folders to C:\\venv\\Lib\\site-packages\\ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM