• centos6下从源码安装setuptools和pip


    1. 下载setuptools及pip的源码包
    	setuptools与pip都是python的模块
    	setuptools源码包: https://pypi.python.org/pypi/setuptools
    	pip源码包: https://pypi.python.org/pypi/pip#downloads
    2. 安装setuptools与pip
    目前下载的版本是setuptools-12.0.5.tar.gz与pip-6.0.6.tar.gz
    用tar命令解压, 格式:tar -xzvf xxxx.tar.gz
    先安装setuptools, 进行setuptools的源码根目录下, 执行以下命令进行setuptools模块的安装:
    [plain] view plain copy
     
    1. # python setup.py install  
    安装完setuptools后, 接着安装pip, 进入pip的源码包根目录下, 执行以下命令进行安装:
    [html] view plain copy
     
    1. # python setup.py build  
    2. # python setup.py install  
    安装完pip后. 看看pip都安装在哪里. 执行以下命令:
    [plain] view plain copy
     
    1. # whereis pip  
    然后再执行 # pip  命令并回车, 如果无法用pip命令, 则可通过创建pip软链接, 执行以下命令:
    [plain] view plain copy
     
    1. # ln -s /usr/local/bin/pip /usr/bin/pip  
    好啦, 检测pip命令是否正常:
    [plain] view plain copy
     
    1. # pip  
    2.   
    3. Usage:     
    4.   pip <command> [options]  
    5.   
    6. Commands:  
    7.   install                     Install packages.  
    8.   uninstall                   Uninstall packages.  
    9.   freeze                      Output installed packages in requirements format.  
    10.   list                        List installed packages.  
    11.   show                        Show information about installed packages.  
    12.   search                      Search PyPI for packages.  
    13.   wheel                       Build wheels from your requirements.  
    14.   zip                         DEPRECATED. Zip individual packages.  
    15.   unzip                       DEPRECATED. Unzip individual packages.  
    16.   help                        Show help for commands.  
    17.   
    18. General Options:  
    19.   -h, --help                  Show help.  
    20.   --isolated                  Run pip in an isolated mode, ignoring  
    21.                               environment variables and user configuration.  
    22.   -v, --verbose               Give more output. Option is additive, and can be  
    23.                               used up to 3 times.  
    24.   -V, --version               Show version and exit.  
    25.   -q, --quiet                 Give less output.  
    26.   --log <path>                Path to a verbose appending log.  
    27.   --proxy <proxy>             Specify a proxy in the form  
    28.                               [user:passwd@]proxy.server:port.  
    29.   --retries <retries>         Maximum number of retries each connection should  
    30.                               attempt (default 5 times).  
    31.   --timeout <sec>             Set the socket timeout (default 15 seconds).  
    32.   --exists-action <action>    Default action when a path already exists:  
    33.                               (s)witch, (i)gnore, (w)ipe, (b)ackup.  
    34.   --trusted-host <hostname>   Mark this host as trusted, even though it does  
    35.                               not have valid or any HTTPS.  
    36.   --cert <path>               Path to alternate CA bundle.  
    37.   --client-cert <path>        Path to SSL client certificate, a single file  
    38.                               containing the private key and the certificate  
    39.                               in PEM format.  
    40.   --cache-dir <dir>           Store the cache data in <dir>.  
    41.   --no-cache-dir              Disable the cache.  
    42.   --disable-pip-version-check  
    43.                               Don't periodically check PyPI to determine  
    44.                               whether a new version of pip is available for  
    45.                               download. Implied with --no-index.  
    如果不创建软链接, 也可以直接使用pip的路径来执行命令也是可以的, 如下:
    [plain] view plain copy
     
    1. # /usr/local/bin/pip  
    2.   
    3. Usage:     
    4.   pip <command> [options]  
    5.   
    6. Commands:  
    7.   install                     Install packages.  
    8.   uninstall                   Uninstall packages.  
    9.   freeze                      Output installed packages in requirements format.  
    10.   list                        List installed packages.  
    11.   show                        Show information about installed packages.  
    12.   search                      Search PyPI for packages.  
    13.   wheel                       Build wheels from your requirements.  
    14.   zip                         DEPRECATED. Zip individual packages.  
    15.   unzip                       DEPRECATED. Unzip individual packages.  
    16.   help                        Show help for commands.  
    17.   
    18. General Options:  
    19.   -h, --help                  Show help.  
    20.   --isolated                  Run pip in an isolated mode, ignoring  
    21.                               environment variables and user configuration.  
    22.   -v, --verbose               Give more output. Option is additive, and can be  
    23.                               used up to 3 times.  
    24.   -V, --version               Show version and exit.  
    25.   -q, --quiet                 Give less output.  
    26.   --log <path>                Path to a verbose appending log.  
    27.   --proxy <proxy>             Specify a proxy in the form  
    28.                               [user:passwd@]proxy.server:port.  
    29.   --retries <retries>         Maximum number of retries each connection should  
    30.                               attempt (default 5 times).  
    31.   --timeout <sec>             Set the socket timeout (default 15 seconds).  
    32.   --exists-action <action>    Default action when a path already exists:  
    33.                               (s)witch, (i)gnore, (w)ipe, (b)ackup.  
    34.   --trusted-host <hostname>   Mark this host as trusted, even though it does  
    35.                               not have valid or any HTTPS.  
    36.   --cert <path>               Path to alternate CA bundle.  
    37.   --client-cert <path>        Path to SSL client certificate, a single file  
    38.                               containing the private key and the certificate  
    39.                               in PEM format.  
    40.   --cache-dir <dir>           Store the cache data in <dir>.  
    41.   --no-cache-dir              Disable the cache.  
    42.   --disable-pip-version-check  
    43.                               Don't periodically check PyPI to determine  
    44.                               whether a new version of pip is available for  
    45.                               download. Implied with --no-index.  
    如果运气不好, 出现如下信息:
    [plain] view plain copy
     
    1. ImportError: No module named 'pip._vendor.requests'  
    这是因为openssl模块没安装好, 可执行以下命令来安装:
    [plain] view plain copy
     
    1. # yum install openssl-devel  
      
      
    OK, Enjoy it!!!
  • 相关阅读:
    用户添加到sudoer列表## Allow root to run any commands anywhere root ALL=(ALL) ALL Iron ALL=(ALL) ALL
    Linux下script命令录制、回放和共享终端操作script -t 2> timing.log -a output.session # 开始录制
    解决nohup: 忽略输入并把输出追加到"nohup.out"或者nohup: 忽略输入重定向错误到标准输出端
    grub救援模式
    如何讓RHEL7/CentOS7開機過程顯示更多資訊
    CSAPP读书随笔之一:为什么汇编器会将call指令中的引用的初始值设置为-4
    对angular实现延迟加载template和controller
    angularjs+jasmine单元测试入门
    设计模式简单工厂之我见
    融云官方cordova示例使用指南
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/8032437.html
Copyright © 2020-2023  润新知