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

    1.介绍:

      虚拟环境就是一个隔离的python环境 不同的项目应该使用不同的虚拟环境,(可以使用同一个虚拟环境),虚拟环境之间是隔离的不会导致环境之间的污染


    2.虚拟环境管理模块的安装

      1.windows系统: pip install virtualenvwrapper-win

      2.mac本            :  pip install virtualenvwrapper

      换源: pip install ...: 会执行两个操作

        1.下载操作:从官网的pypi官网下载

       2.下载完了安装  pip install django==2.0.4 -i https://pypi.tuna.tsinghua.edu.cn/simple

       3.卸载模块:pip uninstall django


    3.virtualenvwrapper的使用

      1.创建虚拟环境cmd:                mkvirtualenv 变量名

          2.激活虚拟环境:                 workon 变量名

          3.查看当前虚拟环境中安装了那些模块(比较全的):     pip list

      4.查看某一个模块的详细信息:                                                       pip show  包名

      5.查看已安装的模块(只显示后续安装的模块):                         pip freeze

      6.查看所有的的虚拟环境:                                                                lsvirtualenv

      7.删除虚拟环境 :                                                                                  rmvirtualenv

      8.退出虚拟环境:                     deactivate

    4.编辑器如何让打开虚拟环境:

      

    4.环境的一致性

      要保证开发与被开发的一致性

      1.在开发机的虚拟环境中运行以下命令:          pip freeze > requirements.txt

      2.在新的虚拟环境中运行命令:                  pip install -r ./requirements.txt 路径

      

  • 相关阅读:
    POJ 1981 Circle and Points (扫描线)
    UVA 1514 Piece it together (二分图匹配)
    CodeForces 140D New Year Contest
    HDU 4863 Centroid of a Tree
    HDU 4865 Peter's Hobby
    HDU 4870 Rating
    HDU 4864 Task
    CodeForces 766E Mahmoud and a xor trip
    CodeForces 766D Mahmoud and a Dictionary
    CodeForces 767D Cartons of milk
  • 原文地址:https://www.cnblogs.com/gaodenghan/p/13203104.html
Copyright © 2011-2022 走看看