问题
I am using Python 2.7.11 and am trying to pip install modules however a few of them are failing. The message I get is "Failure to build wheel for 'X'" and "Error: INCLUDE Environment Variable is empty".
I tried to install Scrapy, LXML and Twisted and those failed. Some other random modules I tried installed fine.
I have installed pyOpenSSL, added python27 and python27/scripts to environment.
Thanks,
回答1:
I tried both the solutions offered, none worked.
I installed Microsoft Visual C++ Compiler for Python 2.7, download it here. Then run:
pip install scrapy
That worked for me
回答2:
A quick solution is to install the pre-compiled version of lxml. You can find it here. If you use the .exe you can point it directly to your python root folder.
After that:
- close and re-open cmd
pip install your_package
(make sure cmd is in the correct directory)- enjoy having no frustrating lxml errors!
Hope this helped.
回答3:
Use a pre built library from this link if you are on windows: https://www.lfd.uci.edu/~gohlke/pythonlibs/
Choose the relevant library given python version and desktop config. For example I want to install apell in python 3.6 and winamd64 then download this:
aspell_python-1.15-cp36-cp36m-win_amd64.whl
Now go to your console and type
pip install path-to-.whl
and that's it.
来源:https://stackoverflow.com/questions/39711629/failure-to-build-wheel-error-include-environment-variable-is-empty