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/

  • 相关阅读:
    迭代器设计模式
    python中的turtle库绘制图形
    Tesseract-OCR4.0识别中文与训练字库实例
    java图片处理
    Tess4J OCR简单使用教程
    C++ 排列最优解算法思想
    Swing使用JavaFXweb组件
    java专业术语
    java的分数类
    System Rules 更好的测试
  • 原文地址:https://www.cnblogs.com/w-jinfeng/p/6047500.html
Copyright © 2011-2022 走看看