Linux服务器中安装Anaconda+Tensorflow+Keras

Anaconda安装

  1. https://repo.anaconda.com/archive/查看你需要下载的Anaconda版本,例如2020.11的x86_64(uname -a 查看linux框架)版

  2. 下载Anaconda到linux服务器,

    python 复制代码
    wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
  3. 安装anaconda:

    python 复制代码
    bash ​Anaconda3-2020.11-Linux-x86_64.sh

创建python虚拟环境

python 复制代码
conda create -n Vpython python=3.6.9
# Vpython: Env name
# python=3.6.9 indicates the version of python for this env
  1. 设置Linux默认的python虚拟环境

    python 复制代码
    vi ~/.bashrc # append a Line 'conda activate Vpython' in the end of this file
    
    
    
    
    # Uncomment the following line if you don't like systemctl's auto-paging feature:
    # export SYSTEMD_PAGER=
    
    # User specific aliases and functions
    
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/home/ZLM/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/home/ZLM/anaconda3/etc/profile.d/conda.sh" ]; then
            . "/home/ZLM/anaconda3/etc/profile.d/conda.sh"
        else
            export PATH="/home/ZLM/anaconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    conda activate Vpython
  2. 安装版本兼容的tensorflow和keras

    python 复制代码
    # Install keras and Tensorflow
    pip install TensorFlow==2.0.0
    pip install keras==2.3.1
    
    
    ####Intall other libs
    pip install numpy
    pip install matplotlib
    pip install scipy
相关推荐
电子_咸鱼3 小时前
高阶数据结构——并查集
数据结构·c++·vscode·b树·python·算法·线性回归
沐知全栈开发3 小时前
深度优先遍历与连通分量
开发语言
生信大杂烩3 小时前
Xenium数据分析 | 使用Xenium Ranger重新分析数据
python·数据分析
古城小栈3 小时前
Go 1.25 发布:性能、工具与生态的全面进化
开发语言·后端·golang
郁大锤3 小时前
OpenAI responses使用教程(三) ——Responses create python SDK 介绍
人工智能·python·ai·openai
@syh.3 小时前
【C++】map和set
开发语言·c++
拾光Ծ3 小时前
C++11实用的“新特性”:列表初始化+右值引用与偷懒艺术——移动语义
开发语言·c++
何憶树之長青3 小时前
Kernel
开发语言·php
hardmenstudent3 小时前
Python字典--第1关:元组使用:这份菜单能修改吗?
开发语言·python
再__努力1点4 小时前
【02】深入理解Harris角点检测:从原理推导到实战实现
python·opencv·计算机视觉·特征提取