关于Linux安装的Python和miniconda

///注意 开头全部是小写建议自己手敲代码不要拷贝

1. Linux下软件的安装:

a) Yum 安装(工具) rpm的增强版

b) Rpm安装 

c) 源码编译安装:python3(LAMP)

d) 脚本安装 *.sh

e) Bin(二进制) .解压配置文件(jdk,tomcat,zookeeper,Hadoop.maven)

2. 源码安装的步骤:

a) 安装编译工具gcc

b) 安装软件的依赖(官网,百度)

c) 下载软件Python3

d) 解压 tar –zxf python3.tar.gz

e) 进入目录

f) ./configure –prefix=/usr/local/python3

g) Make  (make clean)

h) Make install

3. 安装的工具:

a) Wget---curl

b) Lrzsz

c) Vim

d) Gcc

e) 配置yum源,阿里的

4. 网络配置文件:

a) /etc/sysconfig/network-scripts vi ifcfg-ens33

5. Yum源的配置文件

a) /etc/yum.repos.d/

6. 配置环境变量:(不要修正/etc/profile /etc/bashrc)

a) 修正自己家目录 root  /root

b) Zhangsan /home/zhangsan/

i. .bash_profile

ii. .bashrc

c) 修改~/.bashrc

i. export PYTHON_HOME=/usr/local/python3

ii. export PATH=$PATH:$PYTHON_HOME/bin

iii. :wq

d) Source .bashrc

7. cat .bashrc

8. More .bashrc 查看文件

9. 脚本安装:  minianaconda

a) Yum –y install bzip2

b) 下载:

c) wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh

d) bash Miniconda3-4.5.4-Linux-x86_64.sh

e) source .bashrc

f) python3

10. python3 和 Minianaconda

a) python3   -→pip3

b) anaconda--→conda  (pip)

c) conda:

i. 设置conda的镜像

1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

2. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

3. conda config --set show_channel_urls yes

ii. conda list 查看安装的组件

iii. conda install numpy

11. 设置vim的显示行号和tab:

a) Home vim .vimrc

b) Set nu

c) Set ts=4

d) :wq

12. Python 目录下:Vim one.py

a) Print(“hello python!”)

b) :wq

13. Python3 one.py

14. 配置jupyter notebook

a) Python3

1. Echo $PATH

2. Env

3. Pip3 是管理python包的工具

ii. 在PATH去掉anaconda的python3

iii. 更新pip

1. python3 -m pip install --upgrade pip

iv. 安装jupyter

1. python3 -m pip install jupyter

v. 生成配置文件和密码

1. jupyter notebook --generate-config

2. jupyter notebook password

vi. 修改配置文件:

1. ~/.jupyter/ jupyter_notebook_config.py

2. 密码文件: ~/.jupyter/jupyter_notebook_config.json

3. c.NotebookApp.ip='*'

4. c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'

5. c.NotebookApp.open_browser = False

6. c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口

vii. 关闭防火墙

1. Systemctl stop firewalld

2. Firewall-cmd –state

viii. 启动jupyter

1. jupyter notebook --allow-root

b) minianaconda

i. 在路径minianaconda3/

ii. ./bin/conda install jupyter notebook

iii. ./bin/juypter notebook –allow-root

原文地址:https://www.cnblogs.com/zhuhuibiao/p/9246822.html