如何在mac中安装setuptools

Sas*_*ash 9 python django macos install pip

我试图通过pip一些库安装,但我遇到了一些问题.

当我尝试安装其中一些我需要的项目,我得到这样的消息:

$ sudo pip install dj-database-url==0.2.0
Downloading/unpacking dj-database-url==0.2.0
  Downloading dj-database-url-0.2.0.tar.gz
Cleaning up...
setuptools must be installed to install from a source distribution
Run Code Online (Sandbox Code Playgroud)

尝试安装时也会发生这种情况 distribute==0.6.24

有任何想法吗?

Lin*_*Cao 16

1)从中下载ez_setup.py模块

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

2)打开终端

3)cd到你放'ez_setup.py'的目录

4)输入'python ez_setup.py'并运行它.

5)那你应该拥有它.

  • 我不确定这个答案时是否在页面上,但是[Unix包括Mac OS X(curl)]部分(https://pypi.python.org/pypi/setuptools#unix-including- mac-os-x-curl)提供命令`curl https://bootstrap.pypa.io/ez_setup.py -o - | python`,完全按照回答中的描述,只需一个动作,无需显式下载/删除文件.AFAIK`curl`预装在每个Mac OS X系统上. (5认同)