• conda和pip环境管理


    1、anaconda换源

    制定清华的源:
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    有资源显示源地址:
    conda config --set show_channel_urls yes
     

    2、创建一个名为python36的环境,指定Python版本是3.6

    conda create --name python36 python=3.6

    3、激活某个环境

    activate python36 # for Windows

    source activate python36 # for Linux & Mac

    deactivate python36 # for Windows

    source deactivate python36 # for Linux & Mac

    4、 删除一个已有的环境

    conda remove --name python36 --all

    5、conda包管理

    5.1安装xxxx

    conda install xxxx 

    5.2查看当前环境下已安装的包

    conda list 

    5.3查看某个指定环境的已安装包

    conda list -n python36 

    5.4查找package信息

    conda search numpy

    5.5安装package

    conda install -n python34 numpy # 如果不用-n指定环境名称,则被安装在当前活跃环境 也可以通过-c指定通过某个channel安装

    6、Conda 更新 

    6.1 更新package

    conda update -n python34 numpy

     6.2 删除package

    conda remove -n python34 numpy

     6.3 更新conda,保持conda最新

    conda update -n base conda

     6.4 更新anaconda

    conda update anaconda

     6.5 更新python

    conda update python 

    7、pip使用

     # pip安装包

    $ pip install SomePackage

    [...]

      Successfully installed SomePackage

    # pip查看已安装的包

    $ pip show --files SomePackage

      Name: SomePackage

      Version: 1.0

      Location: /my/env/lib/pythonx.x/site-packages

      Files:

       ../somepackage/__init__.py

       [...]

    # pip检查哪些包需要更新

    $ pip list --outdated

      SomePackage (Current: 1.0 Latest: 2.0)

    # pip升级包

    $ pip install --upgrade SomePackage

      [...]

      Found existing installation: SomePackage 1.0

      Uninstalling SomePackage:

        Successfully uninstalled SomePackage

      Running setup.py install for SomePackage

      Successfully installed SomePackage

    # pip卸载

    $ pip uninstall SomePackage

      Uninstalling SomePackage:

        /my/env/lib/pythonx.x/site-packages/somepackage

      Proceed (y/n)? y

      Successfully uninstalled SomePackage

     
  • 相关阅读:
    django大全
    centos 下安装python3.6.2
    爬虫基础知识与简单爬虫实现
    HDU5950 Recursive sequence (矩阵快速幂加速递推) (2016ACM/ICPC亚洲赛区沈阳站 Problem C)
    ZOJ5833 Tournament(递归打表)
    ZOJ4067 Books(贪心)
    ZOJ4062 Plants vs. Zombies(二分+贪心)
    ZOJ4060 Flippy Sequence(思维题)
    洛谷P2568 GCD(线性筛法)
    2018.11.6刷题记录
  • 原文地址:https://www.cnblogs.com/joxin/p/9700721.html
Copyright © 2020-2023  润新知