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
相关推荐
ᐇ9595 分钟前
Java集合框架实战:HashMap与HashSet的妙用
java·开发语言
csbysj202018 分钟前
Scala 异常处理
开发语言
MediaTea28 分钟前
Python 第三方库:cv2(OpenCV 图像处理与计算机视觉库)
开发语言·图像处理·python·opencv·计算机视觉
江塘1 小时前
机器学习-决策树多种生成方法讲解及实战代码讲解(C++/Python实现)
c++·python·决策树·机器学习
多彩电脑1 小时前
死循环逻辑检测
数据结构·python·算法·动态规划
YongCheng_Liang1 小时前
Python 基础核心模块全解析:从入门到实践的知识框架
python
初见无风1 小时前
4.4 Boost库工具类assign 的使用
开发语言·c++·boost
月夜的风吹雨1 小时前
【C++ STL容器适配器】:解密Stack、Queue与Priority Queue的设计智慧
开发语言·c++·stl·优先级队列··队列·适配器
二川bro1 小时前
第45节:分布式渲染:Web Workers多线程渲染优化
开发语言·javascript·ecmascript
RanMatrix1 小时前
python-logging模块
python