先安装yum安装openssl-devel ,否则pip不能安装,或会出现ssl错误
-
查看openssl安装包,发现缺少openssl-devel包
[root@localhost ~]# rpm -aq|grep openssl
openssl-0.9.8e-20.el5
openssl-0.9.8e-20.el5
[root@localhost ~]# -
yum安装openssl-devel
[root@localhost ~]# yum install openssl-devel -y
2 ,安装python3
$ wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
解压
# su root
# tar zxvf Python-3.6.1.tgz
cd到前面那个解压出来的目录
# cd Python-3.6.1
依次执行以下三条命令
# ./configure
# make
# make install
命令行中输入python3,进入python交互,安装成功
-
查看openssl安装包,发现缺少openssl-devel包
[root@localhost ~]# rpm -aq|grep openssl
openssl-0.9.8e-20.el5
openssl-0.9.8e-20.el5
[root@localhost ~]# -
yum安装openssl-devel
[root@localhost ~]# yum install openssl-devel -y
3, 安装pycharm
http://www.jetbrains.com/pycharm/download/#section=linux,选Community版本
下载,解压,然后cd到解压好的目录下的bin,然后./pycharm.sh启动
4,pycharm选python3环境
打开pycharm,菜单选File ---- New project,出现对话框,点下拉框右边的齿轮状图标,点add local,目录中选 之前安装python3的目录下的python,比如 home/Python-3.6.1/python
安装sublime text2,运行python3
菜单选择tools-->build System-->new build system
在打开的文件中贴入以下内容,注意cmd后的路径,是自己安装的目录中的python,
{
"cmd": ["/home/wzg/Python-3.6.1/python","-u","$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
文件名存为python3.sublime-build
然后tools-->build system, 选择python3,就是上面保存的名字
tab设置为4个空格
Preferences-->Settings Default 打开的文件中
"tab_size": 4,
"translate_tabs_to_spaces": true,
另 win7下pip的配置文件位置 C:\ProgramData\pip\pip.ini, 没有的话新建一个