Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install lxml into virtualenv from the local system?

There is lxml module installed on my system (debian package python-lxml, for python 2.6), also I'm using virtualenv based on python2.6, installed with flag --no-site-packages.

Is it possible to install lxml inside virtual environment without compilation using some standard tools (pip, easy_install etc) and already install lxml binary files from the base system?

P.S. I can, of course, manually create symlinks/copy files but don't like this method.

like image 337
Sergey Stolyarov Avatar asked Aug 19 '11 05:08

Sergey Stolyarov


People also ask

How do I import lxml into Python?

Type “ pip install lxml ” (without quotes) in the command line and hit Enter again. This installs lxml for your default Python installation. The previous command may not work if you have both Python versions 2 and 3 on your computer. In this case, try "pip3 install lxml" or “ python -m pip install lxml “.

How do I get lxml version?

In case you want to use the current in-development version of lxml, you can get it from the github repository at https://github.com/lxml/lxml . Note that this requires Cython to build the sources, see the build instructions on the project home page.

Can I install Python inside VENV?

Generally, you can just create this in your project and call it env . venv will create a virtual Python installation in the env folder. You should exclude your virtual environment directory from your version control system using . gitignore or similar.

Does pip install to VENV?

From now on, any package that you install using pip will be placed in the venv folder, isolated from the global Python installation. For Windows, the same command mentioned in step 1 can be used to create a virtual environment.


1 Answers

You may create required symlinks automatically by bootstrap script.

like image 66
Kirill Avatar answered Oct 16 '22 10:10

Kirill