zoukankan      html  css  js  c++  java
  • python 虚拟环境

    python3 目录venv创建为虚拟环境,并激活。

    $ python3 -m venv ./venv
    $ source venv/bin/activate
    -m:   -m mod : run library module as a script (terminates option list)
    $ python3 -m venv --help
    usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
                [--upgrade] [--without-pip]
                ENV_DIR [ENV_DIR ...]
    
    Creates virtual Python environments in one or more target directories.
    
    positional arguments:
      ENV_DIR               A directory to create the environment in.
    
    optional arguments:
      -h, --help            show this help message and exit
      --system-site-packages
                            Give the virtual environment access to the system
                            site-packages dir.
      --symlinks            Try to use symlinks rather than copies, when symlinks
                            are not the default for the platform.
      --copies              Try to use copies rather than symlinks, even when
                            symlinks are the default for the platform.
      --clear               Delete the contents of the environment directory if it
                            already exists, before environment creation.
      --upgrade             Upgrade the environment directory to use this version
                            of Python, assuming Python has been upgraded in-place.
      --without-pip         Skips installing or upgrading pip in the virtual
                            environment (pip is bootstrapped by default)
    
    Once an environment has been created, you may wish to activate it, e.g. by
    sourcing an activate script in its bin directory.

    python2 创建虚拟目录

    安装pip  , virtualenv 

    wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
    sudo python get-pip.py
    sudo pip install virtualenv
    virtualenv venv
    source venv/bin/activate

     pip使用

    https://docs.python.org/3/installing/

  • 相关阅读:
    20160729noip模拟赛zld
    20160728noip模拟赛zld
    20160727noip模拟赛zld
    20160725noip模拟赛“Paodekuai” alexandrali
    20160723数据结构节alexandrali
    20160722noip模拟赛alexandrali
    洛谷 [P2594] 染色游戏
    洛谷 [P3480] KAM-Pebbles
    UVA 1378 A Funny Stone Game
    SPOJ 4060 A game with probability
  • 原文地址:https://www.cnblogs.com/w-jinfeng/p/6047500.html
Copyright © 2011-2022 走看看