[Python3] installation – tarball

Programming

python packages:

https://www.python.org/ftp/python/

I tried install Python-3.6.4  tarball on RHEL6 and RHEL7, looks no problem.

Install pre-required packages


$ sudo yum install openssl openssl-devel -y

Install python3 by tarball


$ wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz

$ tar -xJf Python-3.6.4.tar.xz

$ cd Python-3.6.4

##############
# enable ssl module
##############

$ vi Modules/Setup  <= un-comment the following lines

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto

##############

$ ./configure --prefix=/opt/python3 --with-ssl

$ make && sudo make install

Configure your PATH environment variable


export PYTHON3="/opt/python3/bin"

export PYTHONPATH="/opt/python3/lib/python3.6/site-packages"

export PATH="$PYTHON3:$PATH"

Try to install AWS SDK


$ which pip3
/opt/python3/bin/pip3

$ pip3 -V
pip 9.0.1 from /opt/python3/lib/python3.6/site-packages (python 3.6)

$ sudo pip3 install boto3
Collecting boto3
Downloading https://files.pythonhosted.org/packages/d0/10/fa502e2f1e995e007af3ef1c3ab647a5679990c57ad4d168e25279ca7913/boto3-1.7.63-py2.py3-none-any.whl (128kB)
100% |████████████████████████████████| 133kB 1.3MB/s
Collecting jmespath<1.0.0,>=0.7.1 (from boto3)
Downloading https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3)
Downloading https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl (59kB)
100% |████████████████████████████████| 61kB 2.3MB/s
Collecting botocore<1.11.0,>=1.10.63 (from boto3)
Downloading https://files.pythonhosted.org/packages/57/59/a1221949de618cda560017c9db004d88cc51a5956f6a778f42d54cd190d3/botocore-1.10.63-py2.py3-none-any.whl (4.4MB)
100% |████████████████████████████████| 4.4MB 159kB/s
Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore<1.11.0,>=1.10.63->boto3)
Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
100% |████████████████████████████████| 215kB 2.6MB/s
Collecting docutils>=0.10 (from botocore<1.11.0,>=1.10.63->boto3)
Downloading https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl (543kB)
100% |████████████████████████████████| 552kB 1.2MB/s
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore<1.11.0,>=1.10.63->boto3)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: jmespath, six, python-dateutil, docutils, botocore, s3transfer, boto3
Successfully installed boto3-1.7.63 botocore-1.10.63 docutils-0.14 jmespath-0.9.3 python-dateutil-2.7.3 s3transfer-0.1.13 six-1.11.0
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

ref :

https://blog.csdn.net/jeryjeryjery/article/details/77880227

https://blog.csdn.net/zr1076311296/article/details/75136612

Programming
[Python] Print Formatting

>>> name = ‘Lego Chen’ >>> job = ‘engineer’ >>> print ‘%s is an %s’ %(name, job) Lego Chen is an engineer >>> print ‘%10s is an %20s’ %(name, job) Lego Chen is an engineer >>> print ‘The flotting number is: %10.3f’ %(1000.33356) The flotting number is: 1000.334 >>> print …

jupyter
[Python] Jupyter Server Setup

Purpose: I’d like to setup a jupyter sever that only can be edited by me and I also can share the jupyter notebooks to anyone. There are two URLs, one for admin (me) and another for share to anyone. Admin: https://jupyter-admin.chenlego.me Share(guest): https://jupyter.chenlego.me But, current jupyter server doesn’t support permission management for …

Programming
[Python][Basic] Basic Types

Types Numbers http://nbviewer.jupyter.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Numbers.ipynb cast int(1.5) => 1 float(1) => 1.0 Difference Python2 vs Python3 In Python 2, the / symbol performs what is known as “classic” division, this means that the decimal points are truncated (cut off). 3/2 => 1 In Python 3 however, a single / performs “true” division. …