【问题标题】:install scrapy mac 2.7安装scrapy mac 2.7
【发布时间】:2015-07-09 00:58:05
【问题描述】:

我尝试在我的 mac os x 1.8.5 中安装 scrapy,但非常困难。

我尝试使用页面说明安装de“简单工具”(不容易;)):

https://pypi.python.org/pypi/setuptools

和命令:

curl https://bootstrap.pypa.io/ez_setup.py -o - | python

但总是出错:

iMac-de-ERIKA:~ root$ curl bootstrap.pypa.io/ez_setup.py -o - | python
  % Total    % Received %   Average Speed   Time    Time     Time  Current
                                  Upload   Total   Spent    Left  Speed
100 11434  100 11434    0     0  48685      0 --:--:-- --:--:-- --:--:-- 61473
Downloading pypi.python.org/packages/source/s/setuptools/setuptools-18.0.1.zip
Extracting in /tmp/tmpMz4MuT
Now working in /tmp/tmpMz4MuT/asetuptools-18.0.1a
Installing Setuptools
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-725.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.

Something went wrong during the installation.
See the error message above.

我试过用 root 用户删除目录,但总是:

iMac-de-ERIKA:~ root$ sudo rm -rf /Library/Python/2.7/site-packages
rm: /Library/Python/2.7/site-packages/README: Permission denied
rm: /Library/Python/2.7/site-packages: Permission denied

如何将“--install-dir”参数应用于该指令? 在我的 mac 中安装 scrapy 的一些解决方案?

你能帮帮我吗?

非常感谢!!!

泽维尔。

【问题讨论】:

    标签: python macos curl scrapy


    【解决方案1】:

    需要注意的是,这将在系统上安装除 scrapy 之外的其他一些软件包,我建议安装 homebrew,然后 pip,然后从中进行 scrapy。 命令顺序是

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    brew install python
    brew install pip
    pip install scrapy
    

    您可以分别在http://brew.sh/https://pypi.python.org/pypi/pip 上找到有关这些软件包的更多信息。 基本上 brew 是 mac os x 的包管理器,而 pip 是 python 的包管理器。从 brew 安装 python 会使用它安装 pip,但以防万一,您可以显式安装它。

    【讨论】:

      【解决方案2】:

      就像idea of Akshat,但在我的情况下,我使用sudo 来安装带有pip 的Python 包——包括Scrapy。如果您是 Mac 的管理员,请尝试使用 sudo 执行上述命令以获得写入权限,如错误日志中所述。

      【讨论】:

        猜你喜欢
        • 2013-04-21
        • 1970-01-01
        • 2013-11-08
        • 2023-03-30
        • 1970-01-01
        • 2018-04-16
        • 2018-06-26
        • 1970-01-01
        • 2018-11-19
        相关资源
        最近更新 更多