【python】python安裝lxml報錯【2】


cl : Command line warning D9025 : overriding '/W3' with '/w'

lxml.etree.c

c:\docume~1\admini~1.chi\locals~1\temp\pip_build_Administrator\lxml\src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory

C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

  warnings.warn(msg)

error: command '"C:\Program Files\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe"' failed with exit status 2

 

https://pytools.codeplex.com/workitem/1520

http://stackoverflow.com/questions/20460890/lxml-install-on-windows-7-using-pip-and-python-2-7

 

 

按照如下方式可以安裝lxml

http://stackoverflow.com/questions/20460890/lxml-install-on-windows-7-using-pip-and-python-2-7

However, they should work for various versions as the releases of python and other respective prerequisites change/evolve:

Install Python2.7:
Download the last release of Python2.7 (currently 2.7.6) from the downloads page HERE
Direct link for Win32 MSI installer -> HERE
Direct link for Win64 MSI installer -> HERE
Simply run the MSI to install python. It will register itself in the registry, and appear in Add/REmove Programs.
NOTE: my instructions that follow assume that you choose to install python to the default path of C:\python27\ when asked during the Python Installation Wizard
Add the C:\python27\ and C:\python27\scripts folders to the system path by adding those directories to the PATH environment variable from the Control Panel > System > Advanced System Settings link (Advanced Tab) > Environmental Variables (Button).
(OPTIONAL) Install OpenSSL:
Download Win32 OpenSSL page from HERE for your version of Windows and PC architecture
Download Visual C++ 2008 redistributables for your version of Windows and PC architecture
Download OpenSSL for your version of Windows and architecture (the regular version, not the light one)
Add the following (depending on your architecture) directory (or wherever you insalled to) to your PATH, the same way you added C:\python27 and C:\python27\scripts above:
32-bit:  c:\openssl-win32\bin
64-bit:  c:\openssl-win64\bin
Install Setuptools (get-pip.py should install Setuptools for you), but, just in case...
Download ez_setup.py HERE and save it in C:\python27\scripts
Run C:\python27\scripts> python ez_setup.py
Install PIP
Download get-pip.py from HERE and save it in C:\python27\scripts
Run C:\python27\scripts> python get-pip.py
Install LXML
Download LXML 3.3.3 from HERE for your version of Windows and PC architecture
Run the EXE file

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM