安装scrapy mac 2.7

时间:2015-07-09 00:58:06

标签: python macos curl scrapy

我尝试在我的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的一些解决方案?

你能帮助我吗?

非常感谢!!!

济。

2 个答案:

答案 0 :(得分:0)

需要注意的是,除了scrapy之外,这将在系统上安装一些其他软件包,我建议安装自制软件,然后点播,然后从中进行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,但为了以防万一,你可以显式安装它。

答案 1 :(得分:0)

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