Download python3 under Linux

1. Download
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
2. extracting
the tar--xzvf the Python 3.7.4.tgz
3.config
mkdir -p / usr / local / python3
./configure --prefix = / usr / local / python3 /
4.Make compiled
5.make install install
6. create a shortcut
ln -s / usr / local / python3 / bin / python3 / usr / bin / to python3
LN -s / usr / local / to python3 / bin / PIP3 / usr / bin / PIP3
7. the update PIP3
PIP3 the install --upgrade PIP
add / usr / local / python3 8. environment variable
vi .bash_profile
modified
PATH = $ PATH : $ HOME / bin: / usr / local / python3 / bin
exit editor, activate configuration: Source .bash_profile
1.11.2 common error.
error: ModuleNotFoundError: No module named '_ctypes '
solution: yum install libffi-devel
Error: zipimport.ZipImportError: can not decompress data; zlib not availabl
Solution: yum install zlib-devel
error: No module named '_ssl'
Solution: yum install openssl-devel, and then recompile the installation
error: No module named ' _sqlite3
solution: yum install sqlite-devel, and then recompile the installation
error: ImportError: No module named Tkinter
solution:
yum install Tkinter
yum -y install TCL-devel tk-devel
recompile installation

Guess you like

Origin www.cnblogs.com/pp8080/p/12064726.html