推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
init
V2EX  ›  Python

Windows 下 pip 安装 scrapy 出现问题

  •  
  •   init · Oct 11, 2016 · 4916 views
    This topic created in 3692 days ago, the information mentioned may be changed or developed.
    开始自学 python ,用的是公司的机子 win10 vs2013
    现在最大的问题是有些包安装不了
    比如这种错误
    error: Unable to find vcvarsall.bat

    谷歌了半天
    解决方法有这么几个
    1 Edit your $PythonPath/Lib/distutils/_msvccompiler.py //修改了没有用
    2 modify VS90COMNTOOLS=D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ //该文件夹下并没有 vcvarsall.bat 文件
    3 尝试修改 VS90COMNTOOLS=D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ //该文件夹下有 vcvarsall.bat ,但是重启环境变量之后 安装仍然不成功
    4 安装 vs2015 勾选 python Tools for vs //下载速度实在是感人 放弃了

    不知道有没有人遇到过这些问题

    附参考
    http://stackoverflow.com/questions/2667069/cannot-find-vcvarsall-bat-when-running-a-python-script
    http://stackoverflow.com/questions/33323172/vcvarsall-bat-needed-for-python-to-compile-missing-from-visual-studio-2015-v-1
    http://blog.csdn.net/secretx/article/details/17472107

    上述方法均尝试过。。。无奈
    17 replies  •  2016-10-23 19:22:52 +08:00
    icedx
    icedx
    Oct 11, 2016 via Android
    1
    打了一大段 结果丢了...
    icedx
    icedx
    Oct 11, 2016 via Android❤️1
    2
    1. 你可以用编译好的二进制包
    2. 新版 Python 是通过 VS 安装时添加的注册表来寻找 vcvarsall.bat 的 所以不论怎么修改环境变量都没用
    3. 你可以用 GCC, Google:mingw python 设置好 GCC 环境 然后加 -c mingw32 就可以
    4. 微软有一个 Build tools for python
    5. 喵
    jppxhz01
    jppxhz01
    Oct 11, 2016
    3
    windows 下安装过很多次不成功,这个过了,下面可能还出问题。。。也是醉
    simapple
    simapple
    Oct 11, 2016
    4
    建议还是不要 windows ,主要是 scrapy 的第三方库 太多,往往编译不过,你这还是 vs2013 ,要打算编译的话,试试 vc 9 或者 vs2010 ,反正各种不好办。

    一定要用 windows 的话 去 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载现成的各种库
    woniu127
    woniu127
    Oct 11, 2016 via Android❤️1
    5
    anaconda , pip install scrapy 或者 conda install scrapy
    dong3580
    dong3580
    Oct 11, 2016 via Android
    6
    今天正好遇到
    1.scrapy 在 win 下不支持 python 3
    2.安装 vs c++ com.....for python2.7
    ltux
    ltux
    Oct 11, 2016
    7
    http://www.lfd.uci.edu/~gohlke/pythonlibs/
    pip install scarpy 的时候看具体是哪个包安装失败,那么就去上面的网址下载编译好的包,手工安装。然后继续 pip install scrapy 。 如此反复,直到安装完毕。
    等所有的依赖包都安装完成之后,还需要再 pip install twisted-win ,否则有运行时错误。
    dsg001
    dsg001
    Oct 11, 2016
    8
    win7 + py3.5 安装 scrapy 完木问题
    tcsky
    tcsky
    Oct 11, 2016
    9
    pypm 能装二进制包
    nekoprpr
    nekoprpr
    Oct 11, 2016
    10
    用 vargant 吧, windows 各种蛋疼
    lrh3321
    lrh3321
    Oct 12, 2016
    11
    是 Win10 的话, 就给自带的子系统装吧。
    要不然就按 6 楼说的去安装安装 vs c++ com.....for python2.7
    congeec
    congeec
    Oct 12, 2016
    12
    楼上说了一大堆.............看这个
    cmd /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86 -new_console:t:"VS 14.0" -new_console:C:"%CommonProgramFiles(x86)%\microsoft shared\MSEnv\VSFileHandler.dll,33"

    看不懂的话,打开 Visual Studio,从 IDE 里启动命令行,然后在这个命令行 console 里用 pip 安装, VS 这里启动的 console ,会自动设置好编译所需的环境变量

    嗯, anaconda 是好东西
    junzibuqi124
    junzibuqi124
    Oct 14, 2016
    13
    我先装了 vs2010 ,然后在 pip ,依然不行 然后去 http://www.lfd.uci.edu/~gohlke/pythonlibs/网站下载 scrapy 的 whl 文件,然后直接安装,在下好的 whl 目录进行 pip xxx.whl 就好啦
    PyBot
    PyBot
    Oct 15, 2016 via iPhone
    14
    http://www.mrseattle.cn/wordpress/archives/211.html
    前不久刚好装过 scrapy.通过 wheel 安装就可以了
    firekiller
    firekiller
    Oct 15, 2016
    15
    我遇到过这种问题,楼主放弃的第 4 种方法成功。
    chendajun
    chendajun
    Oct 21, 2016
    16
    最经常出错的地方: lxml , cffi , pywin32 , vc++forpython2.7 ,这几个库安装好了基本就差不多成功了,其中 lxml 和 cffi 又是每次必须报错的地方。 lxml 可以安装 wheel 文件,可以爬过这个大坑。
    mingyun
    mingyun
    Oct 23, 2016
    17
    @PyBot 感谢 python3.5 安装成功
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2087 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 13:24 · PVG 21:24 · LAX 05:24 · JFK 08:24
    ♥ Do have faith in what you're doing.