编写翻译安装javascript,Centos系统一整合体安装
分类:计算机编程

3,解压安装,设置安装路线

tar zxvf Python-3.6.5.tgz

mkdir /usr/local/python365

cd Python-3.6.5

./configure --prefix=/usr/local/python365

make

make install

 

解释:

tar是解压tgz包

./configure --prefix... 是设置python的装置地方

make 是编译源代码,生成目标文件、可实践文件

make install 将编写翻译成功的文件,安装到系统目录,平日为/usl/local/bin

 

布局软连接

ln ./pytho3.6_install/bin/python3.6 python3.6 -s

  1. 开创Python3的软链接

安装python3.6恐怕选取的正视

2,下载安装包

mkdir /usr/local/python3

cd /usr/local/python3

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz

 

表达:也能够在Windows上下载,通过xftp传到linx上

参考:https://jingyan.baidu.com/article/425e69e60cc78abe14fc1640.html

 

./configure --prefix=/usr/local/python3 # 钦赐成立的目录

查阅是或不是已经设置Python

# wget

5,设置情形变量

vi  /etc/profile

export PATH=$PATH:/usr/local/Python365/bin

 

source  /etc/profile       --centos6X需求跟新条件计划

 

表明:编辑景况变量文件,那是永远设置,也正是Windows系统:系统变量Path

参考:http://www.voidcn.com/article/p-hcyvuwuz-bqy.html

 

连带连接: http://www.jb51.net/article/113980.htm
基础情状安插:
yum -y install gcc kernel-devel kenel-headers make bzip2 # 安装正视库

  1. 执行

[root@localhost Python-3.6.4]# yum install gcc -y

一、环境

系统:Centos7

Python:3.6.5  自带pip、setuptools

安装python3.3

$ sudo mkdir /usr/local/python3 # 创立安装目录
$ wget --no-check-certificate https://www.python.org/ftp/python/3.5.4/Python-3.5.4.tgz #下载源文件。注意:wget获取https的时候要增多:--no-check-certificate
$ tar -xzvf Python-3.5.4.tgz # 解压缩包
当下得以平昔利用 tar -xvJf P**.tar.xz来解压
$ cd Python-3.6.0 # 步入解压目录

  1. 浏览器展开 https://www.python.org/ftp/python/ 查看最新的Python版本,标志为3.A.B

# cd /usr/bin

7,更新和测量试验

python --version

python

pip list

pip install --upgrade pip

 

解释:

python --version 当前python版本号

python  步入python交互情状

pip list 测量试验pip暗中同意安装的列表,会有香艳提醒要更新

pip install --upgrade pip 更新pip

yum install readline readline-devel readline-static -y
yum install openssl openssl-devel openssl-static -y # 不然导致pip安装败北
yum install sqlite-devel -y
yum install bzip2-devel bzip2-libs -y
yum install patch vim git # 额外的软件
yum install tcl-devel
yum install tk-devel

图片 1

。。。。

二、命令

说的多,不如直接上命令:

 

pip install --upgrade pip

ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

zipimport.ZipImportError: can't decompress data; zlib not available

6,恢复yum依赖的python2

vi /usr/bin/yum

把文件开始第豆蔻年华行的  #!/usr/bin/python

改成  #!/usr/bin/python2.7  那样就足以了。

 

make altinstall 不隐瞒安装,不建议使用makeinstall 会覆盖

make distclean
相同make clean,但同临时候也将configure生成的公文全部剔除掉,包涵Makefile。

python3

pip3

lrwxrwxrwx. 1 root root    7 Jan 20  2018 /usr/bin/python -> python2

4,设置软连接

cd  /usr/bin

ll -al python*

mv python python.bak

ln -s /usr/local/python365/bin/python3 /usr/bin/python

ln -s /usr/local/python365/bin/pip3 /usr/bin/pip

 

解释:

ll -al python*  查看当前目录含有python的文书并突显软连接

mv python python.bak 因为要安装python命令是运维python3,供给把系统自带的备份后去除

ln -s 指标路线 链接路线

 

yum install python-pip

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

Collecting setuptools

1,安装依赖

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gcc kernel-devel kenel-headers make bzip2 gcc-c zlib zlib-devel libffi-devel

 

分解:不安装信任,会导致局部安装后的主题素材,举个例子:pip、setuptools未有安装

参考:

https://www.cnblogs.com/bigriverx/p/8743008.html

https://www.cnblogs.com/zhangxinqi/p/9074546.html

 

豆瓣源使用极度:

处理:
pip install -i http://pypi.douban.com/simple/ virtualenvwrapper # 先使用http举办连接
pip install -i https://pypi.douban.com/simple/ virtualenvwrapper# ,再使用https连接

mkdir ~/.virtualenvs
在.bashrc中最终加多
export WORKON_HOME=~/.virtualenvs
source /usr/bin/virtualenvwrapper.sh
source ~/.bashrc

CentOS 7.2 私下认可安装了python2.7.5 因为一些限令要用它举例yum 它选拔的是python2.7.5。

make: *** [altinstall] Error 1

yum install epel-release

wget https://www.python.org/ftp/python/3.A.B/Python-3.A.B.tgz

# Centos7默认的 repo有限, 安装epel

修正默以为 Python 3

$ sudo mv python python.bak
$ sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python #创办 python3 的软链接
$ sudo vi /usr/bin/yum #因为 yum 使用 Python 2,因而替换为 Python 3 后或许不能够平常干活,由此修正 yum 配置文件。将首先行钦定的 python 版本改为 python2.7(#!/usr/bin/python 改为 #!/usr/bin/python2.7)

  1. 设置重视情形

安顿2个本子共存

$ sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python3 #创办 python3 的软链接,那样就能够因而 python 命令使用 Python 2,python3 来使用 Python 3。

  1. 测验命令 python3 和 pip3

# make altinstall

编写翻译安装

image

# make

设置虚构景况

pip install virtualenv
pip install pipenv

python 指向的是python2.7

pyenv3的进行文书:/usr/local/bin/pyenv-3.6

链接: https://www.cnblogs.com/justbreaking/p/7103234.html

pip install -i https://pypi.douban.com/simple/
virtualenvwrapper

可以预知推行文书在/usr/bin/ 目录下,切换来该目录下实践 ll python* 命令查看

于今,python3早就设置收尾,测量试验一下:

[root@localhost bin]# whereis python

python: /usr/bin/python /usr/bin/python2.7 /usr/bin/python.backup /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/local/bin/python3.6m /usr/local/bin/python3.6 /usr/local/bin/python3.6m-config /usr/local/lib/python3.6 /usr/include/python2.7 /usr/share/man/man1/python.1.gz

[root@localhost bin]# python

Python 3.6.4 (default, Jan 20 2018, 03:11:08)

[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux

Type "help", "copyright", "credits" or "license" for more information.

安排python3的虚构意况work

mkvirtualnenv
mkvirtualenv --python=/usr/local/python3/bin/python3.5 work

然后采取命令 which python 查看一下Python可试行文件的职责

[root@localhost Python-3.6.4]# yum install bzip2-devel -y

make 编译

行使 python -V 命令查看一下是或不是安装Python

# ./configure --prefix=/usr/local/

安装设想情状模块

  1. 解压下载文件并切换目录

===> 这表明 要先装python的依赖包,先装python的重视性包,先装python的依赖包,主要专门的学问说3遍! 然后 make & make install 等等

  Centos7服务器搭建django项目

pipenv安装战败 错误'install_requires' must

pip install -U setuptools

mkdir /usr/local/python3

pip: /usr/local/bin/pip3.6

仿照效法链接:http://blog.csdn.net/hlj19940416/article/details/53195664

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

# ln -s /usr/local/bin/python3.6 /usr/bin/python3

布局安装pip,暗许源是2.7.5不能安装pip

  1. 创造Pip3的软链接

[root@localhost Python-3.6.4]# ls -l /usr/bin/python*

配置

ssh-keygen

tar -zxvf Python-3.A.B.tgz

cd Python-3.A.B

Collecting pip

图片 2


安装实现

下载最新版源码,使用make altinstall,尽管运用make install,在系统中将会有多个例外版本的Python在/usr/bin/目录中。那将会导致众多主题素材,何况倒霉管理。

安装保留了原python命令调用python2

lrwxrwxrwx. 1 root root    9 Jan 20  2018 /usr/bin/python2 -> python2.7

image

Installing collected packages: setuptools, pip

./configure --prefix=/usr/local/python3

make && make install

pip3的实施文书:/usr/local/bin/pip3.6

  1. 创建Python3的目录

rpm -ivh

[root@localhost Python-3.6.4]# yum install zlib -y

python3 安装成功,消息如下:

Successfully installed pip-9.0.1 setuptools-28.8.0

[root@localhost Python-3.6.4]#

python3.6主次的实践文书:/usr/local/bin/python3.6

-rwxr-xr-x. 1 root root 7136 Aug  3 20:40 /usr/bin/python2.7

# mv  python python.backup

note: 如遇到 "error: no acceptable C compiler found in $PATH"

python3.6应用程序目录:/usr/local/lib/python3.6

# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

[root@localhost Python-3.6.4]# yum install zlib-devel -y

到python官方网址下载https://www.python.org

Important:

1.订正剧本

Centos7下众多脚本是依赖python2.7的,安装完python3随后,非常多脚本不可能正常使用(比方yum), 须求在剧本文件起头改善:

#!/usr/bin/python   ===》 #!/usr/bin/python2.7

2.pip3.6 install django

会报错!!

诸如这样:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Collecting xxx

Could not fetch URLhttps://pypi.python.org/simple/xxxx/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. - skipping

Could not find a version that satisfies the requirement xxx (from versions: )

No matching distribution found for xxx

===》solution:

yum install openssl-devel

重新 make & make install 

更改/usr/bin/python链接 (默认是Python2.7)

[root@localhost Python-3.6.4]# whereis pip

把Python3.6安装到/usr/local 目录

[root@localhost Python-3.6.4]# yum install zlib2 -y

下载python3.6编写翻译安装

Note: 如遇错误,存候装依赖包。

# tar -xzvf Python-3.6.4.tgz -C  /tmp

# cd /tmp/Python-3.6.4/

# ln -s /usr/local/bin/python3.6 /usr/bin/python

本文由pc28.am发布于计算机编程,转载请注明出处:编写翻译安装javascript,Centos系统一整合体安装

上一篇:金额转变到普通话大写金额,上海证交所关于减 下一篇:没有了
猜你喜欢
热门排行
精彩图文