0

我在运行 Mac OS 10.8.4 和 Python 3.3 的 MacBook Pro 上安装了 pip 和 easy_install。当我尝试使用 pip 安装 Scrapy ( http://scrapy.org/ ) 时,我收到底部显示的错误消息。我收到一条与easy_install 类似的错误消息。我最初认为 Scrapy 安装过程有问题,但似乎我无法安装任何 Python 包。我今天刚刚安装了 Python,所以我还没有在这台机器上成功安装过任何 Python 包。任何帮助将不胜感激。

Downloading/unpacking Scrapy

 Getting page https://pypi.python.org/simple/Scrapy/
 URLs to search for versions for Scrapy:
 * https://pypi.python.org/simple/Scrapy/
Analyzing links from page https://pypi.python.org/simple/Scrapy/
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.16.3.tar.gz#md5=cdc9dcea352d66ccfa266bb049006cca (from https://pypi.python.org/simple/Scrapy/), version: 0.16.3
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.7.tar.gz#md5=11710c73ff74dc61c2c68cdc7fdd978a (from https://pypi.python.org/simple/Scrapy/), version: 0.7
Skipping link https://pypi.python.org/packages/any/S/Scrapy/Scrapy-0.9.win32.exe#md5=35c412031e87609a17560d3e50d7edde (from https://pypi.python.org/simple/Scrapy/); unknown archive format: .exe
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.12.0.2550.tar.gz#md5=484059cc53d761c13309eb426e238702 (from https://pypi.python.org/simple/Scrapy/), version: 0.12.0.2550
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.1.tar.gz#md5=104c36b65c6e69fcbe79612fea1d71bd (from https://pypi.python.org/simple/Scrapy/), version: 0.14.1
Skipping link https://pypi.python.org/packages/any/S/Scrapy/Scrapy-0.14.1.win32.exe#md5=48df2ba8404bef75bbabf41d7a50156e (from https://pypi.python.org/simple/Scrapy/); unknown archive format: .exe
Skipping link https://pypi.python.org/packages/any/S/Scrapy/Scrapy-0.8.win32.exe#md5=cb41af67bd0f56ce815af9bb596238ec (from https://pypi.python.org/simple/Scrapy/); unknown archive format: .exe
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.9.tar.gz#md5=4f2db6ad091119a7b80cf64cb5bb4db0 (from https://pypi.python.org/simple/Scrapy/), version: 0.9
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.16.2.tar.gz#md5=0abae280db82f22952f336537ac13454 (from https://pypi.python.org/simple/Scrapy/), version: 0.16.2
Skipping link https://pypi.python.org/packages/any/S/Scrapy/Scrapy-0.7.win32.exe#md5=10b916054d8a554348c2ff7bf435b50d (from https://pypi.python.org/simple/Scrapy/); unknown archive format: .exe
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.16.0.tar.gz#md5=ebdfcfd29b82f987ccbc484fce4ab119 (from https://pypi.python.org/simple/Scrapy/), version: 0.16.0
Skipping link https://pypi.python.org/packages/any/S/Scrapy/Scrapy-0.14.3.win32.exe#md5=5a143abd7e492961c8f2f2fd77ad189f (from https://pypi.python.org/simple/Scrapy/); unknown archive format: .exe
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.2.tar.gz#md5=aefc425cf5eea31eae029146cf8a8755 (from https://pypi.python.org/simple/Scrapy/), version: 0.14.2
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.10.4.2364.tar.gz#md5=bbf6825649990f530897464f556d731f (from https://pypi.python.org/simple/Scrapy/), version: 0.10.4.2364
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.8.tar.gz#md5=d8b1e78d15cb99229438f1211e8d96f8 (from https://pypi.python.org/simple/Scrapy/), version: 0.8
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.4.tar.gz#md5=746868cb92b8a1fbae9fc7e04ce436a5 (from https://pypi.python.org/simple/Scrapy/), version: 0.14.4
Skipping link https://pypi.python.org/packages/any/S/Scrapy/Scrapy-0.14.2.win32.exe#md5=d6afe69f0920d93c55ea6f3fd639ba4a (from https://pypi.python.org/simple/Scrapy/); unknown archive format: .exe
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.16.1.tar.gz#md5=6ecf312070c049d222f1271060cbb7a5 (from https://pypi.python.org/simple/Scrapy/), version: 0.16.1
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.3.tar.gz#md5=59f1225f7692f28fa0f78db3d34b3850 (from https://pypi.python.org/simple/Scrapy/), version: 0.14.3
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.16.5.tar.gz#md5=0033f713509fb39c92d182ea11836b62 (from https://pypi.python.org/simple/Scrapy/), version: 0.16.5
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.18.0.tar.gz#md5=5600a39ceaba12742dc55ba3b6748b7c (from https://pypi.python.org/simple/Scrapy/), version: 0.18.0
Found link https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.16.4.tar.gz#md5=a82c56a9a17cf5dff57c241c40bcb664 (from https://pypi.python.org/simple/Scrapy/), version: 0.16.4
 Using version 0.18.0 (newest of versions: 0.18.0, 0.16.5, 0.16.4, 0.16.3, 0.16.2, 0.16.1, 0.16.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.12.0.2550, 0.10.4.2364, 0.9, 0.8, 0.7)
  Downloading from URL https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.18.0.tar.gz#md5=5600a39ceaba12742dc55ba3b6748b7c (from https://pypi.python.org/simple/Scrapy/)
 Running setup.py egg_info for package Scrapy

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/Scrapy/setup.py", line 67, in <module>

    data = [f for f in filenames if is_not_module(f)]

     File "/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/Scrapy/setup.py", line 67, in <listcomp>

    data = [f for f in filenames if is_not_module(f)]

  File "/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/Scrapy/setup.py", line 58, in is_not_module

    return os.path.splitext(f)[1] not in ['.py', '.pyc', '.pyo']

NameError: global name 'f' is not defined

Complete output from command python setup.py egg_info:

Traceback (most recent call last):

    File "<string>", line 16, in <module>

  File    "/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/Scrapy/setup.py", line 67, in <module>

  data = [f for f in filenames if is_not_module(f)]

 File "/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/Scrapy/setup.py", line 67, in <listcomp>

   data = [f for f in filenames if is_not_module(f)]

 File "/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/Scrapy/setup.py", line 58, in is_not_module

   return os.path.splitext(f)[1] not in ['.py', '.pyc', '.pyo']

NameError: global name 'f' is not defined

打扫干净...

4

1 回答 1

2

http://doc.scrapy.org/en/0.18/intro/install.html上的文档指出,scrapy 需要 2.6 或 2.7。我找不到任何说它可以与更高版本的python一起运行的东西。除了 3.3 之外,您可能还想尝试安装 python 2.7,然后使用 virualenv 运行 scrapy。

于 2013-08-22T20:28:25.447 回答