Python - Is there any way to get pip without setuptools?

半城伤御伤魂 提交于 2019-12-04 04:50:47

Pip does require setuptools. Pip is really just a wrapper around setuptools to provide a better installer than easy_install and some nicer installation behaviors, plus uninstall, requirements files, etc. Even if you somehow got pip installed without setuptools it still won't run without it.

You can use Distribute instead of setuptools: it installs a package called setuptools (it's a fork of the latter). You can install Distribute by downloading and running distribute_setup.py.

Update: As Gringo Suave says, the above is obsolete now - distribute and setuptools have now merged, and the merged project is called setuptools.

You can download setuptools package as Windows installer from pypi/setuptools and then install pip or easy_install

Solution for Windows Users

If you installed ActivePython on Windows, then you have pip by default, as well as PyPM (ActiveState's package manager). The following excerpt is from What's included in ActivePython 2.7:

Additional Packages

  • PyPM: Python Package Manager to download and install binary packages. Also included: virtualenv, Distribute, pip, SQLAlchemy.

Solution for OS X Users

Not sure if setuptools is required when installing pip using homebrew. You might try that.

To install homebrew:

ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"

Then to install pip:

brew install pip

Sure, just grab the source from http://pypi.python.org/pypi/pip/0.8.2#downloads

unpack it, cd into it, and run python setup.py install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!