我是靠谱客的博主 矮小鞋子,这篇文章主要介绍Ubuntu 下安装anaconda创建python虚拟环境及常用包,现在分享给大家,希望可以做个参考。

新建python-env_install.sh文件,写入如下内容:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /usr/bin/bash # 国内采用清华源安装,国外注释下列代码,使用官方源 # ———————————————————————————— # wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2019.07-Linux-x86_64.sh # chmod u+x Anaconda3-2019.07-Linux-x86_64.sh # sh Anaconda3-2019.07-Linux-x86_64.sh # ~/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ # ~/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ # ~/anaconda3/bin/conda config --set show_channel_urls yes # ———————————————————————————— # 官方源安装 # ———————————————————————————— wget https://repo.anaconda.com/archive/Anaconda3-2019.07-Linux-x86_64.sh chmod u+x Anaconda3-2019.07-Linux-x86_64.sh sh Anaconda3-2019.07-Linux-x86_64.sh ~/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ ~/anaconda3/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ ~/anaconda3/bin/conda config --set show_channel_urls yes # ———————————————————————————— # 创建conda虚拟环境py37 ~/anaconda3/bin/conda update anaconda -y ~/anaconda3/bin/conda create -n py37 python==3.7 -y ~/anaconda3/bin/conda activate py37 # 安装常用包 sudo apt install libmariadbd-dev -y ~/anaconda3/envs/py37/bin/pip install flask sqlalchemy flask_sqlalchemy pymysql flask_migrate flask-script Cython configparser psycopg2-binary flask-login flask_pymongo flask-wtf requests elasticsearch==6.3.1 paramiko psutil tornado cryptography openpyxl nltk summa langid pattern sklearn

授予运行权限:chmod u+x python-env_install.sh

运行: sh python-env_install.sh

注意期间提示输入的yes,一路选是就行。

最后

以上就是矮小鞋子最近收集整理的关于Ubuntu 下安装anaconda创建python虚拟环境及常用包的全部内容,更多相关Ubuntu内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(48)

评论列表共有 0 条评论

立即
投稿
返回
顶部