背景
要开发,就需要进行环境配置.很多系统都内置了Python环境.但是系统的环境有些时候并不能瞒住我们的开发需求.比如py2和py3的切换,和同版本的切换.
下面我我介绍的是Anacoda3,当备注了.
开始配置
-
下载地址==> 官网下载
-
执行运行安装
-
配置环境变量
- windows ==>
此电脑->右键选择属性->高级系统设置->环境变量->系统变量->path
- Max/Linux ==>
#Anaconda Python
export CONDA_HOME=/usr/local/anaconda3
export PATH=$CONDA_HOME/bin:$PATH
打开终端,输入命令 ‘conda’,如果有显示则配置成功.
简单介绍一下
安装
conda install opencv //
conda install -c conda-forge opencv //通过conda-forge渠道安装
重要是的切换版本
//创建版本python3
conda create -n py3 python=3
conda create -n py2 python=2
//切换版本
source activate py3 //此时的环境就是python3了
查看安装的库
conda list
信息
$ conda info
//如下
platform : osx-64
conda version : 4.3.30
conda is private : False
conda-env version : 4.3.30
conda-build version : not installed
python version : 3.6.1.final.0
requests version : 2.14.2
root environment : /usr/local/anaconda3 (writable)
default environment : /usr/local/anaconda3
envs directories : /usr/local/anaconda3/envs
/Users/silen/.conda/envs
package cache : /usr/local/anaconda3/pkgs
/Users/silen/.conda/pkgs
channel URLs : https://conda.anaconda.org/mine/osx-64
https://conda.anaconda.org/mine/noarch
https://repo.continuum.io/pkgs/main/osx-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
config file : /Users/silen/.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.30 requests/2.14.2 CPython/3.6.1 Darwin/16.7.0 OSX/10.12.6
UID:GID : 501:20
还有就是一些常规的帮助,更新,卸载,清理.
网友评论