V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
saximi
V2EX  ›  Python

请教安装 Scrapy 时的这个错误如何解决

  •  
  •   saximi · 2017-08-20 14:29:12 +08:00 · 3490 次点击
    这是一个创建于 2651 天前的主题,其中的信息可能已经有所发展或是发生改变。
    32 位的 WINDOWS7,PYTHON3.6 环境下要安装 Scrapy-1.4.0-py2.py3-none-any.whl ,这个 whl 文件已经下载并放到 python 目录下,输入命令为 pip install Scrapy-1.4.0-py2.py3-none-any.whl
    安装了很多包后,出现了以下的出错提示,请问这是什么原因导致的,如何解决呢?感谢指点!

    Requirement already satisfied: pyparsing in d:\python\python3\lib\site-packages (from packaging>=16.8->setuptools->zope.interfac
    e>=4.0.2->Twisted>=13.1.0->Scrapy==1.4.0)
    Installing collected packages: Twisted, Scrapy
    Running setup.py install for Twisted ... error
    Exception:
    Traceback (most recent call last):
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 2: invalid continuation byte

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\req\req_install.py", line 878, in install
    spinner=spinner,
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 2: invalid continuation byte

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\commands\install.py", line 385, in run
    requirement_set.cleanup_files()
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\req\req_set.py", line 729, in cleanup_files
    req.remove_temporary_source()
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\req\req_install.py", line 977, in remove_temporary_source
    rmtree(self.source_dir)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\six.py", line 686, in reraise
    raise value
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
    File "d:\python\python3\lib\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
    File "d:\python\python3\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
    File "d:\python\python3\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
    File "d:\python\python3\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
    [Previous line repeated 1 more times]
    File "d:\python\python3\lib\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\__init__.py", line 114, in rmtree_errorhandler
    func(path)
    Permissi onError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'c:\\TEMP\\pip-build-n_4iqc5q\\Twisted\\src\\twisted\\i
    nternet\\iocpreactor\\iocpsupport\\iocpsupport.c'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\commands\install.py", line 385, in run
    requirement_set.cleanup_files()
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\build.py", line 38, in __exit__
    self.cleanup()
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\build.py", line 42, in cleanup
    rmtree(self.name)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\six.py", line 686, in reraise
    raise value
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
    File "d:\python\python3\lib\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
    File "d:\python\python3\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
    File "d:\python\python3\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
    File "d:\python\python3\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
    [Previous line repeated 2 more times]
    File "d:\python\python3\lib\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
    File "C:\Users\YY\AppData\Roaming\Python\Python36\site-packages\pip\utils\__init__.py", line 114, in rmtree_errorhandler
    func(path)
    Permissi onError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'c:\\TEMP\\pip-build-n_4iqc5q\\Twisted\\src\\twisted\\i
    nternet\\iocpreactor\\iocpsupport\\iocpsupport.c'
    10 条回复    2017-08-20 18:54:43 +08:00
    tennc
        1
    tennc  
       2017-08-20 14:35:01 +08:00
    安装姿势错了~~ win 下不是这样安装的 。。。。 要么需要第三方集成包 要么换系统安装 scrapy
    dsg001
        2
    dsg001  
       2017-08-20 15:01:30 +08:00
    根据报错先安装各个依赖,最后安装 scrapy
    leoforza
        3
    leoforza  
       2017-08-20 15:17:57 +08:00
    我自己似乎是先单独安装 lxml 和 twisted 的 whl,装好以后再安装 scrapy 的 whl 装好的
    saximi
        4
    saximi  
    OP
       2017-08-20 15:53:18 +08:00
    @leoforza lxml 我已经安装完毕了,twisted 我是从 https://pypi.python.org/pypi 上找的 Twisted-17.5.0.tar.bz2 ,解压后,用 pip install setup.py 来安装时提示:
    Could not find a version that satisfies the requirement setup.py (from versions: )
    No matching distribution found for setup.py

    难道这个版本不适用于 32 位的 WINDOWS 7 么? 那这样就找不到其他版本了,我是 INTEL 的芯片。
    saximi
        5
    saximi  
    OP
       2017-08-20 15:53:58 +08:00
    @tennc 请问哪里可以下载第三方集成包呢?感谢!
    fiht
        6
    fiht  
       2017-08-20 16:10:36 +08:00
    还有用 32 位机器的的 Python 开发者 的 ahhh
    (路过帮顶,不是很熟悉 Windows 的那套
    leoforza
        7
    leoforza  
       2017-08-20 16:13:31 +08:00
    @saximi 要不还是在 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 这个网页上找 whl 安装吧,tar.bz2 压缩包安装我也经常出问题
    saximi
        8
    saximi  
    OP
       2017-08-20 16:45:48 +08:00
    @leoforza 谢谢这个网址的 twisted 可以顺利安装了
    saximi
        9
    saximi  
    OP
       2017-08-20 16:46:33 +08:00
    @fiht 您说的 ahhh 是集成包么?哪里可以下载呢?谢谢
    fiht
        10
    fiht  
       2017-08-20 18:54:43 +08:00
    @saximi 啊哈哈哈 (逃
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2846 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 14:05 · PVG 22:05 · LAX 06:05 · JFK 09:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.