XiaLab培訓(xùn)環(huán)境搭建

Xialab 培訓(xùn)環(huán)境運行

目錄

一是整、數(shù)據(jù)存放
二厢蒜、環(huán)境配置

  1. 進入自己的環(huán)境葛菇,這里以zzh的為例
  2. 查看當前conda可利用的環(huán)境
  3. 嘗試進入“training”環(huán)境壶辜,進入環(huán)境時報錯
  4. 退出,并重新登錄
  5. 嘗試運行環(huán)境中已安裝包的命令铛漓,檢測環(huán)境配置
  6. 切換回自己的conda環(huán)境

一溯香、數(shù)據(jù)存放

數(shù)據(jù)存在 /home/tmp/data里面,直接復(fù)制或者軟連接到自己環(huán)境中浓恶,之后培訓(xùn)數(shù)據(jù)都更新在該目錄
(base) [zaohai_zeng@localhost ~]$ ln -s /home/tmp/data/
(base) [zaohai_zeng@localhost ~]$ cd data/
(base) [zaohai_zeng@localhost data]$ ll -htr
total 298M
-rw-r--r--. 1 root xialab  62M Jul 10 17:55 embryophyta_odb9.tar.gz
-rw-r--r--. 1 root xialab 102M Jul 10 17:55 eudicotyledons_odb10.tar.gz
-rw-r--r--. 1 root xialab  13M Jul 10 17:55 eukaryota_odb9.tar.gz
-r-xr-xr-x. 1 root xialab 117M Jul 10 18:00 Arabidopsis_thaliana.genome.fa
-r-xr-xr-x. 1 root xialab 4.8M Jul 10 18:00 Arabidopsis_thaliana.genome.gff3

二玫坛、環(huán)境配置

曾灶海和張艷青的我已經(jīng)測試過,是可以用的,其他成員按照如下描述去配置,出現(xiàn)問題再看怎么解決憔四。

1. 進入自己的環(huán)境,這里以zzh的為例

選擇 3 進入zzh用戶home目錄

------------------------------------
--    Welcome to Terminal Menu    --
------------------------------------
[1] > Start New Selection.(UTF-8 character)
[2] > Start New Selection.(GBK character)

History sessions:
[3] < 192.168.253.186  zaohai_zeng  SSH  UTF-8

[q] < Quit.


Choice: 3

Prepare to login to the target device, Please wait a second.

Last login: Wed Jul 10 12:05:41 2019 from 192.168.253.92

2. 查看當前conda可利用的環(huán)境

輸入如下命令勉痴,查看conda環(huán)境,其中“flye_test”和“training”為培訓(xùn)所需的兩個環(huán)境树肃。

(base) [zaohai_zeng@localhost ~]$ /opt/anaconda/bin/conda info --envs
# conda environments:
#
                      *  /home/zaohai_zeng/miniconda2
                         /home/zaohai_zeng/miniconda2/envs/py2
base                     /opt/anaconda
flye_test                /opt/anaconda/envs/flye_test
training                 /opt/anaconda/envs/training

3. 嘗試進入“training”環(huán)境蒸矛,進入環(huán)境時報錯

嘗試激活‘training’環(huán)境,遇到報錯如下:

(base) [zaohai_zeng@localhost ~]$ /opt/anaconda/bin/conda activate training

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

按照提示運行 /opt/anaconda/bin/conda init命令胸嘴,將conda寫入.bashrc文件

(base) [zaohai_zeng@localhost ~]$ /opt/anaconda/bin/conda init
no change     /opt/anaconda/condabin/conda
no change     /opt/anaconda/bin/conda
no change     /opt/anaconda/bin/conda-env
no change     /opt/anaconda/bin/activate
no change     /opt/anaconda/bin/deactivate
no change     /opt/anaconda/etc/profile.d/conda.sh
no change     /opt/anaconda/etc/fish/conf.d/conda.fish
no change     /opt/anaconda/shell/condabin/Conda.psm1
no change     /opt/anaconda/shell/condabin/conda-hook.ps1
no change     /opt/anaconda/lib/python3.7/site-packages/xontrib/conda.xsh
no change     /opt/anaconda/etc/profile.d/conda.csh
modified      /home/zaohai_zeng/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

4. 退出雏掠,并重新登錄

(base) [zaohai_zeng@localhost ~]$ exit
logout



------------------------------------
--    Welcome to Terminal Menu    --
------------------------------------
[1] > Start New Selection.(UTF-8 character)
[2] > Start New Selection.(GBK character)

History sessions:
[3] < 192.168.253.186  zaohai_zeng  SSH  UTF-8

[q] < Quit.


Choice: 3

Prepare to login to the target device, Please wait a second.

Last login: Wed Jul 10 12:09:19 2019 from 192.168.253.92
(base) [zaohai_zeng@localhost ~]$

重新進入環(huán)境后,執(zhí)行命令conda activate training劣像,如果 [user] (這里的user是zaohai_zeng@localhost) 前圓括號中的 base —> training磁玉,說明你已成功進入環(huán)境

(base) [zaohai_zeng@localhost ~]$ which conda
/opt/anaconda/bin/conda
(base) [zaohai_zeng@localhost ~]$ conda info --envs
# conda environments:
#
                         /home/zaohai_zeng/miniconda2
                         /home/zaohai_zeng/miniconda2/envs/py2
base                  *  /opt/anaconda
flye_test                /opt/anaconda/envs/flye_test
training                 /opt/anaconda/envs/training

(base) [zaohai_zeng@localhost ~]$ conda activate training
(training) [zaohai_zeng@localhost ~]$

5. 嘗試運行環(huán)境中已安裝包的命令,如果能出現(xiàn)如下提示那么恭喜你驾讲,你的環(huán)境配置好了

augustus命令

(training) [zaohai_zeng@localhost ~]$ augustus
AUGUSTUS (3.3.2) is a gene prediction tool
written by M. Stanke, O. Keller, S. K?nig, L. Gerischer and L. Romoth.

usage:
augustus [parameters] --species=SPECIES queryfilename

'queryfilename' is the filename (including relative path) to the file containing the query sequence(s)
in fasta format.

SPECIES is an identifier for the species. Use --species=help to see a list.

parameters:
--strand=both, --strand=forward or --strand=backward
--genemodel=partial, --genemodel=intronless, --genemodel=complete, --genemodel=atleastone or --genemodel=exactlyone
  partial      : allow prediction of incomplete genes at the sequence boundaries (default)
  intronless   : only predict single-exon genes like in prokaryotes and some eukaryotes
  complete     : only predict complete genes
  atleastone   : predict at least one complete gene
  exactlyone   : predict exactly one complete gene
--singlestrand=true
  predict genes independently on each strand, allow overlapping genes on opposite strands
  This option is turned off by default.
--hintsfile=hintsfilename
  When this option is used the prediction considering hints (extrinsic information) is turned on.
  hintsfilename contains the hints in gff format.
--AUGUSTUS_CONFIG_PATH=path
  path to config directory (if not specified as environment variable)
--alternatives-from-evidence=true/false
  report alternative transcripts when they are suggested by hints
--alternatives-from-sampling=true/false
  report alternative transcripts generated through probabilistic sampling
--sample=n
--minexonintronprob=p
--minmeanexonintronprob=p
--maxtracks=n
  For a description of these parameters see section 4 of README.TXT.
--proteinprofile=filename
  When this option is used the prediction will consider the protein profile provided as parameter.
  The protein profile extension is described in section 7 of README.TXT.
--progress=true
  show a progressmeter
--gff3=on/off
  output in gff3 format
--predictionStart=A, --predictionEnd=B
  A and B define the range of the sequence for which predictions should be found.
--UTR=on/off
  predict the untranslated regions in addition to the coding sequence. This currently works only for a subset of species.
--noInFrameStop=true/false
  Do not report transcripts with in-frame stop codons. Otherwise, intron-spanning stop codons could occur. Default: false
--noprediction=true/false
  If true and input is in genbank format, no prediction is made. Useful for getting the annotated protein sequences.
--uniqueGeneId=true/false
  If true, output gene identifyers like this: seqname.gN

For a complete list of parameters, type "augustus --paramlist".
An exhaustive description can be found in the file README.TXT.

braker.pl命令

(training) [zaohai_zeng@localhost ~]$ braker.pl

braker.pl     Pipeline for predicting genes with GeneMark-ET and AUGUSTUS with
            RNA-Seq

SYNOPSIS

braker.pl [OPTIONS] --genome=genome.fa --bam=rnaseq.bam

INPUT FILE OPTIONS

--genome=genome.fa                  fasta file with DNA sequences
--bam=rnaseq.bam                    bam file with spliced alignments from
                                    RNA-Seq
--hints=hints.gff                   Alternatively to calling braker.pl with a
                                    bam file, it is possible to call it with a
                                    file that contains introns extracted from
                                    RNA-Seq (or other data) in gff format.
                                    This flag also allows the usage of hints
                                    from additional extrinsic sources for gene
                                    prediction with AUGUSTUS. To consider such
                                    additional extrinsic information, you need
                                    to use the flag --extrinsicCfgFiles to
                                    specify parameters for all sources in the
                                    hints file (including the source "E" for
                                    intron hints from RNA-Seq).
--prot_seq=prot.fa                  A protein sequence file in multiple fasta
                                    format. This file will be used to generate
                                    protein hints for AUGUSTUS by running one
                                    of the three alignment tools Exonerate
                                    (--prg=exonerate), Spaln (--prg=spaln) or
                                    GenomeThreader (--prg=gth). Default is
                                    GenomeThreader if the tool is not
                                    specified.  Currently, hints from protein
                                    sequences are only used in the prediction
                                    step with AUGUSTUS.
--prot_aln=prot.aln                 Alignment file generated from aligning
                                    protein sequences against the genome with
                                    either Exonerate (--prg=exonerate), or
                                    Spaln (--prg=spaln), or GenomeThreader
                                    (--prg=gth).
                                    To prepare alignment file, run Spaln2 with
                                    the following command:
                                    spaln -O0 ... > spalnfile
                                    To prepare alignment file, run Exonerate
                                    with the following command:
                                    exonerate --model protein2genome \
                                        --showtargetgff T ... > exfile
                                    To prepare alignment file, run
                                    GenomeThreader with the following command:
                                    gth -genomic genome.fa  -protein \
                                        protein.fa -gff3out \
                                        -skipalignmentout ... -o gthfile
                                    A valid option prg=... must be specified
                                    in combination with --prot_aln. Generating
                                    tool will not be guessed.
                                    Currently, hints from protein alignment
                                    files are only used in the prediction step
                                    with AUGUSTUS.
--AUGUSTUS_ab_initio                output ab initio predictions by AUGUSTUS
                                    in addition to predictions with hints by
                                    AUGUSTUS

FREQUENTLY USED OPTIONS

--species=sname                     Species name. Existing species will not be
                                    overwritten. Uses Sp_1 etc., if no species
                                    is assigned
--softmasking                       Softmasking option for soft masked genome
                                    files. (Disabled by default.)
--esmode                            Run GeneMark-ES (genome sequence only) and
                                    train AUGUSTUS on long genes predicted by
                                    GeneMark-ES. Final predictions are ab initio
--epmode                            Run GeneMark-EP with intron hints provided
                                    from protein data. This mode is not
                                    comptabile with using the aligners
                                    GenomeThreader, Exonerate and Spaln within
                                    braker.pl because etpmode and epmode require
                                    a large database of proteins and such
                                    mapping should be done outside of braker.pl
                                    e.g. on a cluster.
--etpmode                           Run GeneMark-ETP with hints provided from
                                    proteins and RNA-Seq data. This mode is not
                                    compatible with using the aligners
                                    GenomeThreader, Exonerate and Spaln within
                                    braker.pl because etpmode and epmode require
                                    a large database of proteins and such
                                    mapping should be done outside of braker.pl
                                    e.g. on a cluster.
--gff3                              Output in GFF3 format (default is gtf
                                    format)
--cores                             Specifies the maximum number of cores that
                                    can be used during computation. Be aware:
                                    optimize_augustus.pl will use max. 8
                                    cores; augustus will use max. nContigs in
                                    --genome=file cores.
--workingdir=/path/to/wd/           Set path to working directory. In the
                                    working directory results and temporary
                                    files are stored
--nice                              Execute all system calls within braker.pl
                                    and its submodules with bash "nice"
                                    (default nice value)

--alternatives-from-evidence=true   Output alternative transcripts based on
                                    explicit evidence from hints (default is
                                    true).
--crf                               Execute CRF training for AUGUSTUS;
                                    resulting parameters are only kept for
                                    final predictions if they show higher
                                    accuracy than HMM parameters.
--keepCrf                           keep CRF parameters even if they are not
                                    better than HMM parameters
--UTR=on                            create UTR training examples from RNA-Seq
                                    coverage data; requires options
                                    --bam=rnaseq.bam and --softmasking.
                                    Alternatively, if UTR parameters already
                                    exist, training step will be skipped and
                                    those pre-existing parameters are used.
--prg=gth|exonerate|spaln           Alignment tool gth (GenomeThreader),
                                    exonerate (Exonerate) or Spaln2
                                    (spaln) that will be used to generate
                                    protein alignments that will be the
                                    basis for hints generation for gene
                                    prediction with AUGUSTUS (if specified
                                    in combination with --prot_seq) or that
                                    was used to externally generate an
                                    alignment file with the commands listed in
                                    description of --prot_aln (if used in
                                    combination with --prot_aln).
--gth2traingenes                    Generate training gene structures for
                                    AUGUSTUS from GenomeThreader alignments.
                                    (These genes can either be used for
                                    training AUGUSTUS alone with
                                    --trainFromGth; or in addition to
                                    GeneMark-ET training genes if also a
                                    bam-file is supplied.)
--trainFromGth                      No GeneMark-Training, train AUGUSTUS from
                                    GenomeThreader alignments
--version                           Print version number of braker.pl
--help                              Print this help message

CONFIGURATION OPTIONS (TOOLS CALLED BY BRAKER)

--AUGUSTUS_CONFIG_PATH=/path/       Set path to config directory of AUGUSTUS
                                    (if not specified as environment
                                    variable). BRAKER1 will assume that the
                                    directories ../bin and ../scripts of
                                    AUGUSTUS are located relative to the
                                    AUGUSTUS_CONFIG_PATH. If this is not the
                                    case, please specify AUGUSTUS_BIN_PATH
                                    (and AUGUSTUS_SCRIPTS_PATH if required).
                                    The braker.pl commandline argument
                                    --AUGUSTUS_CONFIG_PATH has higher priority
                                    than the environment variable with the
                                    same name.
--AUGUSTUS_BIN_PATH=/path/          Set path to the AUGUSTUS directory that
                                    contains binaries, i.e. augustus and
                                    etraining. This variable must only be set
                                    if AUGUSTUS_CONFIG_PATH does not have
                                    ../bin and ../scripts of AUGUSTUS relative
                                     to its location i.e. for global AUGUSTUS
                                    installations. BRAKER1 will assume that
                                    the directory ../scripts of AUGUSTUS is
                                    located relative to the AUGUSTUS_BIN_PATH.
                                    If this is not the case, please specify
                                    --AUGUSTUS_SCRIPTS_PATH.
--AUGUSTUS_SCRIPTS_PATH=/path/      Set path to AUGUSTUS directory that
                                    contains scripts, i.e. splitMfasta.pl.
                                    This variable most only be set if
                                    AUGUSTUS_CONFIG_PATH or AUGUSTUS_BIN_PATH
                                    do not contains the ../scripts directory
                                    of AUGUSTUS relative to their location,
                                    i.e. for special cases of a global
                                    AUGUSTUS installation.
--BAMTOOLS_PATH=/path/to/           Set path to bamtools (if not specified as
                                    environment BAMTOOLS_PATH variable). Has
                                    higher priority than the environment
                                    variable.
--GENEMARK_PATH=/path/to/           Set path to GeneMark-ET (if not specified
                                    as environment GENEMARK_PATH variable).
                                    Has higher priority than environment
                                    variable.
--SAMTOOLS_PATH=/path/to/           Optionally set path to samtools (if not
                                    specified as environment SAMTOOLS_PATH
                                    variable) to fix BAM files automatically,
                                    if necessary. Has higher priority than
                                    environment variable.
--ALIGNMENT_TOOL_PATH=/path/to/tool Set path to alignment tool
                                    (GenomeThreader, Spaln, or Exonerate) if
                                    not specified as environment
                                    ALIGNMENT_TOOL_PATH variable. Has higher
                                    priority than environment variable.
--BLAST_PATH=/path/to/blastall      Set path to NCBI blastall and formatdb
                                    executables if not specified as
                                    environment variable. Has higher priority
                                    than environment variable.
--PYTHON3_PATH=/path/to             Set path to python3 executable (if not
                                    specified as envirnonment variable and if
                                    executable is not in your $PATH).

EXPERT OPTIONS

--augustus_args="--some_arg=bla"    One or several command line arguments to
                                    be passed to AUGUSTUS, if several
                                    arguments are given, separated by
                                    whitespace, i.e.
                                    "--first_arg=sth --second_arg=sth".
--overwrite                         Overwrite existing files (except for
                                    species parameter files)
--skipGeneMark-ES                   Skip GeneMark-ES and use provided
                                    GeneMark-ES output (e.g. provided with
                                    --geneMarkGtf=genemark.gtf)
--skipGeneMark-ET                   Skip GeneMark-ET and use provided
                                    GeneMark-ET output (e.g. provided with
                                    --geneMarkGtf=genemark.gtf)
--skipGeneMark-EP                   Skip GeneMark-EP and use provided
                                    GeneMark-EP output (e.g. provided with
                                    --geneMarkGtf=genemark.gtf)
--skipGeneMark-ETP                  Skip GeneMark-ETP and use provided
                                    GeneMark-ETP output (e.g. provided with
                                    --geneMarkGtf=genemark.gtf)
--geneMarkGtf=file.gtf              If skipGeneMark-ET is used, braker will by
                                    default look in the working directory in
                                    folder GeneMarkET for an already existing
                                    gtf file. Instead, you may provide such a
                                    file from another location. If geneMarkGtf
                                    option is set, skipGeneMark-ES/ET/EP/ETP is
                                    automatically also set.
--rounds                            The number of optimization rounds used in
                                    optimize_augustus.pl (default 5)
--skipAllTraining                   Skip GeneMark-EX (training and
                                    prediction), skip AUGUSTUS training, only
                                    runs AUGUSTUS with pre-trained and already
                                    existing parameters (not recommended).
                                    Hints from input are still generated.
                                    This option automatically sets
                                    --useexisting to true.
--useexisting                       Use the present config and parameter files
                                    if they exist for 'species'
--filterOutShort                    It may happen that a "good" training gene,
                                    i.e. one that has intron support from
                                    RNA-Seq in all introns predicted by
                                    GeneMark, is in fact too short. This flag
                                    will discard such genes that have
                                    supported introns and a neighboring
                                    RNA-Seq supported intron upstream of the
                                    start codon within the range of the
                                    maximum CDS size of that gene and with a
                                    multiplicity that is at least as high as
                                    20% of the average intron multiplicity of
                                    that gene.
--skipOptimize                      Skip optimize parameter step (not
                                    recommended).
--skipGetAnnoFromFasta              Skip calling the python3 script
                                    getAnnoFastaFromJoingenes.py from the
                                    AUGUSTUS tool suite. This script requires
                                    python3, biopython and re (regular
                                    expressions) to be installed. It produces
                                    coding sequence and protein FASTA files
                                    from AUGUSTUS gene predictions and provides
                                    information about genes with in-frame stop
                                    codons. If you enable this flag, these files
                                    will not be produced and python3 and
                                    the required modules will not be necessary
                                    for running braker.pl.
--fungus                            GeneMark-ET option: run algorithm with
                                    branch point model (most useful for fungal
                                    genomes)
--rnaseq2utr_args=params            Expert option: pass alternative parameters
                                    to rnaseq2utr as string, default parameters:
                                    -r 76 -v 100 -n 15 -i 0.7 -m 0.3 -w 70
                                    -c 100 -p 0.5
--eval=reference.gtf                Reference set to evaluate predictions
                                    against (using the eval package)
--AUGUSTUS_hints_preds=s            File with AUGUSTUS hints predictions; will
                                    use this file as basis for UTR training;
                                    only UTR training and prediction is
                                    performed if this option is given.
--flanking_DNA=n                    Size of flanking region, must only be
                                    specified if --AUGUSTUS_hints_preds is given
                                    (for UTR training in a separate braker.pl
                                    run that builds on top of an existing run)
--verbosity=n                       0 -> run braker.pl quiet (no log)
                                    1 -> only log warnings
                                    2 -> also log configuration
                                    3 -> log all major steps
                                    4 -> very verbose, log also small steps
--downsampling_lambda=d             The distribution of introns in training
                                    gene structures generated by GeneMark-EX
                                    has a huge weight on single-exon and
                                    few-exon genes. Specifying the lambda
                                    parameter of a poisson distribution will
                                    make braker call a script for downsampling
                                    of training gene structures according to
                                    their number of introns distribution, i.e.
                                    genes with none or few exons will be
                                    downsampled, genes with many exons will be
                                    kept. Default value is 2.
                                    If you want to avoid downsampling, you have
                                    to specify 0.

DEVELOPMENT OPTIONS (PROBABLY STILL DYSFUNCTIONAL)

--splice_sites=patterns             list of splice site patterns for UTR
                                    prediction; default: GTAG, extend like this:
                                    --splice_sites=GTAG,ATAC,...
--extrinsicCfgFiles=file1,file2,... Depending on the mode in which braker.pl
                                    is executed, it may require one ore several
                                    extrinsicCfgFiles. Don't use this option
                                    unless you know what you are doing!
--stranded=+,-,+,-,...              If UTRs are trained, i.e.~strand-specific
                                    bam-files are supplied and coverage
                                    information is extracted for gene prediction,
                                    create stranded ep hints. The order of
                                    strand specifications must correspond to the
                                    order of bam files. Possible values are
                                    +, -, .
                                    If stranded data is provided, ONLY coverage
                                    data from the stranded data is used to
                                    generate UTR examples! Coverage data from
                                    unstranded data is used in the prediction
                                    step, only.
                                    The stranded label is applied to coverage
                                    data, only. Intron hints are generated
                                    from all libraries treated as "unstranded"
                                    (because splice site filtering eliminates
                                    intron hints from the wrong strand, anyway).
--optCfgFile=ppx.cfg                Optional custom config file for AUGUSTUS
                                    for running PPX (currently not
                                    implemented)

DESCRIPTION

Example:


braker.pl [OPTIONS] --genome=genome.fa --species=speciesname \
    --bam=accepted_hits.bam
braker.pl [OPTIONS] --genome=genome.fa --species=speciesname \
    --hints=rnaseq.gff

To run with protein data from remote species and GeneMark-EP:

braker.pl [OPTIONS] --genome=genome.fa --hints=proteinintrons.gff --epmode=1

To run with protein data from a very closely related species:

braker.pl [OPTIONS] --genome=genome.fa --prot_seq=proteins.fa --prg=gth \
    --gth2traingenes --trainFromGth

6. 如何切換回自己的conda環(huán)境

① 暫時切換到user的conda環(huán)境,退出shell重登切換會失效

如退出登錄后席赂,其是在/opt/anaconda的名字為base環(huán)境中吮铭,若想切換回自己/home/zaohai_zeng/miniconda2/envs/py2名為py2的環(huán)境中。

(base) [zaohai_zeng@localhost ~]$ which conda
/opt/anaconda/bin/conda
(base) [zaohai_zeng@localhost ~]$ conda info --envs
# conda environments:
#
                         /home/zaohai_zeng/miniconda2
                         /home/zaohai_zeng/miniconda2/envs/py2
base                  *  /opt/anaconda
busco                    /opt/anaconda/envs/busco
flye_test                /opt/anaconda/envs/flye_test
training                 /opt/anaconda/envs/training

找到當前用戶 conda 環(huán)境的 conda 命令所在位置(一般在/path/to/miniconda2/bin下面)颅停,如本user的:

(base) [zaohai_zeng@localhost ~]$ ls /home/zaohai_zeng/miniconda2/bin/conda
/home/zaohai_zeng/miniconda2/bin/conda

查看 當前用戶自己的conda環(huán)境有哪些谓晌?

(base) [zaohai_zeng@localhost ~]$ /home/zaohai_zeng/miniconda2/bin/conda info --envs
# conda environments:
#
base                     /home/zaohai_zeng/miniconda2
py2                      /home/zaohai_zeng/miniconda2/envs/py2

然后執(zhí)行命令source /home/zaohai_zeng/miniconda2/bin/activate py2切換進 py2 環(huán)境:

(base) [zaohai_zeng@localhost ~]$ source /home/zaohai_zeng/miniconda2/bin/activate py2
(py2) [zaohai_zeng@localhost ~]$ which python
~/miniconda2/envs/py2/bin/python
(py2) [zaohai_zeng@localhost ~]$ python --version
Python 2.7.13 :: Continuum Analytics, Inc.
② 永久刪除/opt/anaconda的環(huán)境

找到用戶.bashrc文件

vim .bashrc

然后刪除這一段代碼

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/opt/anaconda/etc/profile.d/conda.sh" ]; then
        . "/opt/anaconda/etc/profile.d/conda.sh"
    else
        export PATH="/opt/anaconda/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

截圖如下:


image.png

退出重登 shell即可永久回到user自己的conda環(huán)境中。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末癞揉,一起剝皮案震驚了整個濱河市纸肉,隨后出現(xiàn)的幾起案子溺欧,更是在濱河造成了極大的恐慌,老刑警劉巖柏肪,帶你破解...
    沈念sama閱讀 222,183評論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件姐刁,死亡現(xiàn)場離奇詭異,居然都是意外死亡烦味,警方通過查閱死者的電腦和手機聂使,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,850評論 3 399
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來谬俄,“玉大人柏靶,你說我怎么就攤上這事±B郏” “怎么了屎蜓?”我有些...
    開封第一講書人閱讀 168,766評論 0 361
  • 文/不壞的土叔 我叫張陵,是天一觀的道長钥勋。 經(jīng)常有香客問我炬转,道長,這世上最難降的妖魔是什么笔诵? 我笑而不...
    開封第一講書人閱讀 59,854評論 1 299
  • 正文 為了忘掉前任返吻,我火速辦了婚禮,結(jié)果婚禮上乎婿,老公的妹妹穿的比我還像新娘测僵。我一直安慰自己,他們只是感情好谢翎,可當我...
    茶點故事閱讀 68,871評論 6 398
  • 文/花漫 我一把揭開白布捍靠。 她就那樣靜靜地躺著,像睡著了一般森逮。 火紅的嫁衣襯著肌膚如雪榨婆。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,457評論 1 311
  • 那天褒侧,我揣著相機與錄音良风,去河邊找鬼。 笑死闷供,一個胖子當著我的面吹牛烟央,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播歪脏,決...
    沈念sama閱讀 40,999評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼疑俭,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了婿失?” 一聲冷哼從身側(cè)響起钞艇,我...
    開封第一講書人閱讀 39,914評論 0 277
  • 序言:老撾萬榮一對情侶失蹤啄寡,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后哩照,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體挺物,經(jīng)...
    沈念sama閱讀 46,465評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,543評論 3 342
  • 正文 我和宋清朗相戀三年葡秒,在試婚紗的時候發(fā)現(xiàn)自己被綠了姻乓。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,675評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡眯牧,死狀恐怖蹋岩,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情学少,我是刑警寧澤剪个,帶...
    沈念sama閱讀 36,354評論 5 351
  • 正文 年R本政府宣布,位于F島的核電站版确,受9級特大地震影響扣囊,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜绒疗,卻給世界環(huán)境...
    茶點故事閱讀 42,029評論 3 335
  • 文/蒙蒙 一侵歇、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧吓蘑,春花似錦惕虑、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,514評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至琳猫,卻和暖如春伟叛,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背脐嫂。 一陣腳步聲響...
    開封第一講書人閱讀 33,616評論 1 274
  • 我被黑心中介騙來泰國打工统刮, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人账千。 一個月前我還...
    沈念sama閱讀 49,091評論 3 378
  • 正文 我出身青樓侥蒙,卻偏偏與公主長得像,于是被迫代替她去往敵國和親蕊爵。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 45,685評論 2 360