|
楼主 |
发表于 2016-7-22 13:12:23
|
显示全部楼层
Linux下安装步骤
0、安装或更新python依赖的库
yum install bzip2-devel -y
yum install openssl-devel -y
yum install readline-devel
1、下载https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz 并解压- wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
- tar xzvf Python-3.5.2.tgz
- cd Python-3.5.2
复制代码 2、编译3、安装4、测试- python3
- Python 3.5.2 (default, Jul 23 2016, 00:30:05)
- [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>>import ssl
- >>>import urllib.request
- >>>print(urllib.request.urlopen('https://fah.manho.org').read().decode('utf8'))
复制代码 若import ssl语句提示报错,说明该机未安装openssl-devel包。请安装此包- yum install openssl-devel -y
复制代码 然后然后重做 第2~4 步
若print(urllib.request.urlopen('https://fah.manho.org').read().decode('utf8'))语句没有输出,或报错,请联系我。
|
|