赞
踩
Python本身自带了一套工具distutils ,用于发布 Python 应用程序。但 distutils 没有提供定义其它依赖包的功能,setuptools 的真正优点并不在于实现distutils 所能实现的功能——尽管它的确增强了distutils的功能并简化了setup.py 脚本中的内容。setuptools 最大的优势是它在包管理能力方面的增强。它可以使用一种更加透明的方法来查找、下载并安装依赖包;并可以在一个包的多个版本中自由进行切换,这些版本都安装在同一个系统上;也可以声明对某个包的特定版本的需求;还可以只使用一个简单的命令就能更新到某个包的最新版本。
简单来说,Python setuptools可以看做是增强版的distutils,用来管理Python的各种包。
一般在CentOS系统安装完成后,Python编译器就已经会安装好了,对于setuptools工具的安装,可以用ea_setup.py脚本的方法,自动下载安装包并安装;也可以先下载完整的setuptools安装包,然后再单独安装。
一、以ez_setup.py脚本方式安装setuptools工具
使用ez_setup.py脚本的方法比较简单,但要注意服务器要能够联网下载软件包,安装命令为:
# cd /usr/local/src/
# wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
# python ez_setup.py --insecure
安装的过程为:
# wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py --2015-08-27 10:43:48-- https://bootstrap.pypa.io/ez_setup.py Resolving bootstrap.pypa.io... 103.245.222.175 Connecting to bootstrap.pypa.io|103.245.222.175|:443... connected. WARNING: certificate common name “*.c.ssl.fastly.net” doesn’t match requested host name “bootstrap.pypa.io”. HTTP request sent, awaiting response... 200 OK Length: 11432 (11K) [text/x-python] Saving to: “ez_setup.py” 100%[===================================================================>] 11,432 --.-K/s in 0s 2015-08-27 10:43:49 (692 MB/s) - “ez_setup.py” saved [11432/11432] # # python ez_setup.py --insecure Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-18.2.zip Extracting in /tmp/tmpn65Wy1 Now working in /tmp/tmpn65Wy1/setuptools-18.2 Installing Setuptools running install running bdist_egg running egg_info writing requirements to setuptools.egg-info/requires.txt writing setuptools.egg-info/PKG-INFO writing top-level names to setuptools.egg-info/top_level.txt writing dependency_links to setuptools.egg-info/dependency_links.txt writing entry points to setuptools.egg-info/entry_points.txt writing requirements to setuptools.egg-info/requires.txt writing setuptools.egg-info/PKG-INFO writing top-level names to setuptools.egg-info/top_level.txt writing dependency_links to setuptools.egg-info/dependency_links.txt writing entry points to setuptools.egg-info/entry_points.txt reading manifest file 'setuptools.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'setuptools.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib copying easy_install.py -> build/lib creating build/lib/setuptools copying setuptools/py26compat.py -> build/lib/setuptools copying setuptools/unicode_utils.py -> build/lib/setuptools copying setuptools/py31compat.py -> build/lib/setuptools copying setuptools/windows_support.py -> build/lib/setuptools copying setuptools/package_index.py -> build/lib/setuptools copying setuptools/archive_util.py -> build/lib/setuptools copying setuptools/dist.py -> build/lib/setuptools copying setuptools/py27compat.py -> build/lib/setuptools copying setuptools/msvc9_support.py -> build/lib/setuptools copying setuptools/version.py -> build/lib/setuptools copying setuptools/compat.py -> build/lib/setuptools copying setuptools/__init__.py -> build/lib/setuptools copying setuptools/utils.py -> build/lib/setuptools copying setuptools/sandbox.py -> build/lib/setuptools copying setuptools/extension.py -> build/lib/setuptools copying setuptools/lib2to3_ex.py -> build/lib/setuptools copying setuptools/depends.py -> build/lib/setuptools copying setuptools/ssl_support.py -> build/lib/setuptools copying setuptools/site-patch.py -> build/lib/setuptools creating build/lib/_markerlib copying _markerlib/markers.py -> build/lib/_markerlib copying _markerlib/__init__.py -> build/lib/_markerlib creating build/lib/pkg_resources copying pkg_resources/__init__.py -> build/lib/pkg_resources creating build/lib/setuptools/command copying setuptools/command/bdist_rpm.py -> build/lib/setuptools/command copying setuptools/command/develop.py -> build/lib/setuptools/command copying setuptools/command/build_ext.py -> build/lib/setuptools/command copying setuptools/command/install.py -> build/lib/setuptools/command copying setuptools/command/upload_docs.py -> build/lib/setuptools/command copying setuptools/command/register.py -> build/lib/setuptools/command copying setuptools/command/build_py.py -> build/lib/setuptools/command copying setuptools/command/saveopts.py -> build/lib/setuptools/command copying setuptools/command/alias.py -> build/lib/setuptools/command copying setuptools/command/install_egg_info.py -> build/lib/setuptools/command copying setuptools/command/__init__.py -> build/lib/setuptools/command copying setuptools/command/test.py -> build/lib/setuptools/command copying setuptools/command/easy_install.py -> build/lib/setuptools/command copying setuptools/command/rotate.py -> build/lib/setuptools/command copying setuptools/command/sdist.py -> build/lib/setuptools/command copying setuptools/command/setopt.py -> build/lib/setuptools/command copying setuptools/command/egg_info.py -> build/lib/setuptools/command copying setuptools/command/bdist_egg.py -> build/lib/setuptools/command copying setuptools/command/install_scripts.py -> build/lib/setuptools/command copying setuptools/command/install_lib.py -> build/lib/setuptools/command copying setuptools/command/bdist_wininst.py -> build/lib/setuptools/command creating build/lib/pkg_resources/_vendor copying pkg_resources/_vendor/__init__.py -> build/lib/pkg_resources/_vendor creating build/lib/pkg_resources/_vendor/packaging copying pkg_resources/_vendor/packaging/_structures.py -> build/lib/pkg_resources/_vendor/packaging copying pkg_resources/_vendor/packaging/__about__.py -> build/lib/pkg_resources/_vendor/packaging copying pkg_resources/_vendor/packaging/specifiers.py -> build/lib/pkg_resources/_vendor/packaging copying pkg_resources/_vendor/packaging/version.py -> build/lib/pkg_resources/_vendor/packaging copying pkg_resources/_vendor/packaging/__init__.py -> build/lib/pkg_resources/_vendor/packaging copying pkg_resources/_vendor/packaging/_compat.py -> build/lib/pkg_resources/_vendor/packaging copying setuptools/script (dev).tmpl -> build/lib/setuptools copying setuptools/script.tmpl -> build/lib/setuptools creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/setuptools copying build/lib/setuptools/py26compat.py -> build/bdist.linux-x86_64/egg/setuptools creating build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/bdist_rpm.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/develop.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/build_ext.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/install.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/upload_docs.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/register.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/build_py.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/saveopts.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/alias.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command/install_egg_info.py -> build/bdist.linux-x86_64/egg/setuptools/command copying build/lib/setuptools/command
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。