Failure to build wheel / “Error: INCLUDE Environment Variable is empty”

假如想象 提交于 2021-02-07 13:20:30

问题


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:

  1. close and re-open cmd
  2. pip install your_package (make sure cmd is in the correct directory)
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!