刘勇虎的官方网站
网站内容包含大前端、服务器开发、Python开发、iOS开发、Android开发、网站维护等技术文章。专注于分享技术经验,职业心得体会,IT优秀文章与教程创作。
Stay hungry,Stay foolish,Stay young
题记
购买了一个月的服务器和公网ip,计划用Python与Nginx写一个web服务,于是踏上了漫漫的摸索之路。
1.本地ssh连接。
2.mkdir /usr/local/python3
3.wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
wget 无法解析主机地址 “www.python.org”
sudo vim /etc/resolv.conf
在文件中添加信息
nameserver 8.8.8.8
4.解压资源包 (tar命令详解)
tar -xf Python-3.7.0.tgz
5.进入文件夹Python-3.7.0,配置安装路径,注意:等号前后不应该有空格
./configure –prefix=/usr/local/python3
6.编译、安装可执行文件
make && make install
zipimport.ZipImportError: can't decompress data; zlib not available
yum install zlib*
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
ModuleNotFoundError: No module named '_ctypes'
yum install libffi-devel -y
cd /usr/bin
mv python python.bak
ln –s /usr/local/python3/bin/python3 /usr/bin/python
8.查看版本至此告一段落 ~
[-Wmaybe-uninitialized]
解决
make
sudo make
解决
yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
解决:重新安装python
./configure --prefix=/usr/local/python3.6.3 --with-ssl
make
sudo make