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
相关推荐
于是我说12 小时前
Python Requests Session Cookies 与 JSON 文件的存取
python·json·dubbo
烤麻辣烫12 小时前
黑马程序员苍穹外卖(新手)DAY12
java·开发语言·学习·spring·intellij-idea
nix.gnehc12 小时前
PyTorch自动求导
人工智能·pytorch·python
多恩Stone12 小时前
【Pytorch 深入理解(2)】减少训练显存-Gradient Checkpointing
人工智能·pytorch·python
MM_MS12 小时前
C# 线程与并发编程完全指南:从基础到高级带详细注释版(一篇读懂)
开发语言·机器学习·计算机视觉·c#·简单工厂模式·visual studio
t***316512 小时前
QT开发:事件循环与处理机制的概念和流程概括性总结
开发语言·qt
mortimer12 小时前
视频自动翻译里的“时空折叠”:简单实用的音画同步实践
python·ffmpeg·aigc
serve the people12 小时前
tensorflow tf.function 的 多态性(Polymorphism)
人工智能·python·tensorflow
龙泉寺天下行走12 小时前
[PowerShell 入门教程] 第9.5天(间章):PowerShell 常见 Cmdlet 速查手册
开发语言·php
muxin-始终如一12 小时前
Semaphore 使用及原理详解
java·开发语言·python