zoukankan      html  css  js  c++  java
  • centos 安装配置python虚拟环境、pip

    centos 安装配置python虚拟环境、pip

    1.安装pip包安装工具
    # 系统默认源没有pip安装包
    [root@localhost python]# yum install python-pip
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: repos.dfw.quadranet.com
    * extras: sjc.edge.kernel.org
    * updates: mirror.hmc.edu
    No package python-pip available.
    Error: Nothing to do
    # 安装epel源
    [root@localhost python]# yum -y install epel-release
    # 再次安装
    [root@localhost python]# yum install python-pip
    .....
    Installed:
    python2-pip.noarch 0:8.1.2-6.el7

    Complete!
    # 安装成功


    2.安装virtualenv
    2.1 使用pip安装virtualenv
    [root@localhost python]# pip install virtualenv
    如果提示You should consider upgrading via the 'pip install --upgrade pip' command.
    就执行pip install --upgrade pip更新后再安装即可
    2.2 使用yum安装virtualenv
    [root@localhost python]# yum install python-virtualenv

    3.配置python虚拟环境
    # 创建名为env1的虚拟环境
    [root@localhost python]# virtualenv env1

    # 进入虚拟环境
    [root@localhost python]# source env1/bin/activate
    (env1) [root@localhost python]#

    # 退出虚拟环境
    (env1) [root@localhost python]# deactivate
    [root@localhost python]#

  • 相关阅读:
    973. K Closest Points to Origin
    919. Complete Binary Tree Inserter
    993. Cousins in Binary Tree
    20. Valid Parentheses
    141. Linked List Cycle
    912. Sort an Array
    各种排序方法总结
    509. Fibonacci Number
    374. Guess Number Higher or Lower
    238. Product of Array Except Self java solutions
  • 原文地址:https://www.cnblogs.com/change06/p/9800152.html
Copyright © 2011-2022 走看看