Python 环境 安装
这里我们使用conda来管理python,安装conda后自带python环境。
Conda
因为pip的诸多不便,现在决定使用conda!!!
安装
- centos
sudo yum -y install bzip2wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.shsh Miniconda3-latest-Linux-x86_64.shsource ~/.bashrc卸载的时候,删除文件夹和环境变量即可。
- mac
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.shsh Miniconda3-latest-MacOSX-x86_64.sh# 环境变量# added by Anaconda3 installerexport PATH="/Users/apple/miniconda3/bin:$PATH"
- windows
1、下载最新版本
2、设置环境变量

配置
1、配置安装源
# 配置安装源conda config --add channels biocondaconda config --add channels conda-forgeconda config --add channels genomedk# 清华源conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/查看channelscat ~/.condarc
2、conda自身的升级和卸载
# 升级conda update condaconda update anaconda# 卸载rm -rf anaconda目录清理 .bashrc环境配置
软件管理
# 安装conda install gatk=3.7conda listconda update gatkconda remove gatk
常用软件
pip install bpython # linux\mac
python版本管理
1、查看目前conda所有环境

2、创建和管理python2环境
# 创建一个名为python2.7 的环境conda create -n python2.7 python=2.7# 激活 test 环境source activate python2.7# 退出环境source deactivate# 删除环境conda remove -n python2.7 --all
pip
因为很多软件都是通过pip安装,所以我们可以修改一下pip安装源
# linux~/.pip/pip.conf[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple# win10进入 %appdata%,新建一个pip文件夹,新建文件pip.ini[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple
或者临使用安装源
pip install jupyter -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
BUG
Ubuntu系统可能会遇到网络访问问题。
Collecting package metadata (current_repodata.json): failedCondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/genomedk/linux-64/current_repodata.json>Elapsed: -An HTTP error occurred when trying to retrieve this URL.HTTP errors are often intermittent, and a simple retry will get you on your way.'https://conda.anaconda.org/genomedk/linux-64'
解决方案:
vim ~/.condarc
channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/show_channel_urls: truessl_verify: false
windows安装备份
1、下载地址:https://www.python.org/downloads/windows/
2、安装的时候选择加入到环境变量
