目录
1.配置好一个Ubuntu14 的服务器或虚拟机,这里选择的是VMware 虚拟机一枚
3.1 原始的source.list 内容,当然也可以是其它的镜像源,自己替换
4.2 解压 tar -zxvf Python-3.6.8.tgz
步骤:
1.配置好一个Ubuntu14 的服务器或虚拟机,这里选择的是VMware 虚拟机一枚
2.配置网络,配置IP基本信息,配置DNS
2.1 配置IP如下:
root@ubuntu:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 172.18.xx.xx
netmask 255.255.0.0
network 172.18.0.0
broadcast 172.18.255.255
gateway 172.18.0.1
dns-servernames 114.114.114.114
2.2 配置域名解析
root@ubuntu:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 114.114.114.114
3.配置Ubuntu 源
3.1 原始的source.list 内容,当然也可以是其它的镜像源,自己替换
root@ubuntu:~# cat /etc/apt/sources.list
#
# deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release amd64 (20140416.2)]/ trusty main restricted
#deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release amd64 (20140416.2)]/ trusty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty universe
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner
## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu trusty main
# deb-src http://extras.ubuntu.com/ubuntu trusty main
4.下载python 3.6.8源码,解压源码包进行编译
https://www.python.org/downloads/release/python-368/
4.1 下载源码包
4.2 解压 tar -zxvf Python-3.6.8.tgz
4.3 编译源码
cd Python-3.6.8
./configure --prefix=/usr/local/python368
make && make install
如果
如果 configure 错误
请安装 gcc 或者更新gcc
apt-get update
apt-get build-dep gcc
5.配置虚拟环境
这个看个人情况
6.将python3.6.8环境做成一个离线环境,即插即用
将 /usr/local/python368 打成 tgz 然后导出来放到一个离线的ubuntu上,解压就可以直接使用了