A wheel是分發預編譯包以便通過pip安裝的新方式。爲什麼「pip install lxml」不使用提供的輪子,並嘗試編譯?
lxml entry on pypi有輪子可用於「manylinux」。我正在運行Ubuntu。
但是,當我嘗試pip安裝lxml時,似乎無論如何嘗試編譯。任何想法爲什麼?
mktmpenv
pip install lxml==3.6.4
Collecting lxml==3.6.4
Using cached lxml-3.6.4.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml
Complete output from command /home/harry/.virtualenvs/tmp-940224e01c89b3f0/bin/python3 -c "import setuptools;__file__='/tmp/pip-build-gxw05tyo/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp78u4a871pip-wheel-:
Building lxml version ....
Building lxml version 3.6.4.
Building without Cython.
Using build configuration of libxslt 1.1.29
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
[...etc]
任何想法?
一些模塊用C/C++代碼和作者決定不編譯它。你不要自己編譯 - pip會爲你做。我從來沒有在Linux Mint上編譯lxml的問題(基於Ubuntu 14.04) – furas
如果你想預先定義lxml然後使用[Anaconda](https://docs.continuum.io/anaconda/pkg-docs) - 它會安裝Python和已經爲此Python版本預編譯了lxml和其他模塊。 – furas
謝謝@furas,我實際上可以安裝這個軟件包,我的問題是關於爲什麼即使預編譯輪可用,pip也想編譯。澄清了我的帖子。 – hwjp