python 编译安装与脚本安装

编译安装的一般步骤:
安装依赖,安装依赖的第三方的工具,yum可以解决
编译安装的包中都有:configure 文件
进行预编译:检查你的环境是否合格
./configure --prefix=xxx
生成编译的文件:MakeFile

python安装:
安装依赖

linux>yum -y install gcc
linux>yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma 

预编译:

linux>./configure --prefix=/opt/install/python3 --enable-optimizations
linux>make && make install

安装交互与设密

linux>cd /opt/install/python3/
linux> bin/pip3 install ipython3
linux> bin/pip3 install ipython
linux> bin/ipython3  //交互式提示

linux>bin/pip3 install jupyter notebook 
如果报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-fhjrdyjl/markupsafe/
You are using pip version 10.0.1, however version 23.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
解决办法:
linux> bin/pip3 install --upgrade pip==23.1.2

#生成配置文件
linux>bin/jupyter notebook --generate-config
在python的开发环境下 
linux>bin/python3
>>> from notebook.auth import passwd   //导入包然后写个password
>>> passwd()在·
Enter password:
Verify password:
'argon2:$argon2id$v=19$m=10240,t=10,p=8$kzSVdH70s31gVaA1GZRFOg$rDtOpmy9FiOiNng2HOimv+VdvlXIQw1GLMdnHeDCKRI'(复制此行密码,每人不一样)

在这里插入图片描述

linux>vim  ~/.jupyter/jupyter_notebook_config.py
修改#c.NotebookApp.password = u'asfasdfasdfasdfasd'	//修改密码
c.NotebookApp.ip = '*'		//ip
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888(根据端口情况修改)
c.NotebookApp.allow_remote_access = True

关闭防护墙并启动

linux> bin/jupyter notebook --allow-root //安装好jupyter后启动服务
        http://192.168.58.203:8888/tree

python 编译安装与脚本安装_第1张图片
python 编译安装与脚本安装_第2张图片

脚本安装
下载网址:mirrors.tuna.tsinghua.edu.cn

linux> bash Miniconda3-py37_4.8.2-Linux-x86_64.sh 
Enter 回车
Do you accept the license terms? [yes|no]
[no] >>> yes

Miniconda3 will now be installed into this location:
/root/miniconda3
  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below
[/root/miniconda3] >>> /opt/install/minicond3

----是否写在配置文件里面 no  可能会把原来的python给搞宕
Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> no
安装好后进入软件目录
发行版 最好用bin/conda
linux> bin/conda --help
linux> bin/conda list  //查看min下安装的软件
linux> bin/conda install ipython
linux> bin/conda install ipython3
linux> bin/ipython3

你可能感兴趣的:(python,python,开发语言,linux)