之前通过源码包方式安装python不断报错,于是尝试安装Anaconda

1. Anaconda与python的关系:Anaconda指的是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。里面所包含的Jupyter Notebook是数据挖掘领域中最热门的工具。简而言之,安装了Anaconda,python也就安上了

2. 环境:服务器,Red Hat Enterprise Linux Server release 6.6 (Santiago)  

3. 下载:下载最新的Anaconda包含64位Python3.8(此时最新版本为python3.9,可能3.8比较稳定)。

wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh

安装:运行下载的脚本文件,之后一路enter或yes。

          在一系列声明之后需要确认安装位置(第一个yes/no),可以默认安装或定义安装目录。需要注意的是一个字符都不能输错,我选择的是默认安装位置,当然最好也是默认安装位置,非root用户安装到~/anaconda3。下面第二张图片的配置时间较长,二十分钟左右。

sh Anaconda3-2020.11-Linux-x86_64.sh

配置环境变量:服务器用户(非root)在~/.bash_profile文件最后一行添加Anaconda的绝对路径

export PATH=$PATH:/anaconda3路径/bin
source .bash_profile

但是source后可能会报错(也可能不会),如下图,一开始以为是Java的问题。后来又source一遍,就没有报错了,神奇!!

运行:成功运行anaconda和python3.8,安装成功

(base) [hanjiangang@jianglin ~]$ python3.8
Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

(base) [hanjiangang@jianglin ~]$ anaconda -h
usage: anaconda [-h] [--disable-ssl-warnings] [--show-traceback] [-v] [-q] [-V] [-t TOKEN] [-s SITE]  ...

Anaconda repository command line manager

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit

output:
  --disable-ssl-warnings
                        Disable SSL warnings (default: False)
  --show-traceback      Show the full traceback for chalmers user errors (default: False)
  -v, --verbose         print debug information on the console
  -q, --quiet           Only show warnings or errors on the console

anaconda-client options:
  -t TOKEN, --token TOKEN
                        Authentication token to use. May be a token or a path to a file containing a token
  -s SITE, --site SITE  select the anaconda-client site to use

Commands:
  
    auth                Manage Authorization Tokens
    label               Manage your Anaconda repository labels
    channel             [DEPRECATED in favor of label] Manage your Anaconda repository channels
    config              Anaconda client configuration
    copy                Copy packages from one account to another
    download            Download notebooks from your Anaconda repository
    groups              Manage Groups
    login               Authenticate a user
    logout              Log out from your Anaconda repository
    move                Move packages between labels
    notebook            Interact with notebooks in your Anaconda repository
    package             Package utils
    remove              Remove an object from your Anaconda repository. Must refer to the formal package name as it appears in the URL of the package. Also use anaconda
                        show <USERNAME> to see list of package names. Example: anaconda remove continuumio/empty-example-notebook
    search              Search in your Anaconda repository
    show                Show information about an object
    upload              Upload packages to your Anaconda repository
    whoami              Print the information of the current user

当然,最后不能忘了心心念的cutadapt,也成功安装,happy!

总结:这种python安装方式简单快捷,报错少,真的是非root用户的福音,不知道之前为什么智障般用源码包安装方式死磕。

Logo

更多推荐