Persiapan Sebelum menginstall Python
Untuk menginstall python terdapat beberapa hal yang harus dipersiapkan diantaranya:
-
Server atau komputer harus terkoneksi dengan internet
-
Terinstall Aplikasi build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl,libbz2-dev
Langkah Instalasi Python
langkah pertama karena saya menggunakan server login via ssh
ssh user@192.168.0.112
The authenticity of host '192.168.0.112 (192.168.0.112)' can't be established.
ECDSA key fingerprint is SHA256:7KenQn5f4cK8DyvEo+uC4UclhAmfF5G8dIauSlDOMFo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.112' (ECDSA) to the list of known hosts.
user@192.168.0.112's password:
Linux tukanglinux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Jun 27 21:40:02 2020
langkah selanjutnya install dependensi yang diperlukan dengan perintah
apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev
langkah selanjutnya install curl dengan perintah
apt-get install curl
root@tukanglinux:/home/user# apt install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libcurl4
The following NEW packages will be installed:
curl libcurl4
0 upgraded, 2 newly installed, 0 to remove and 18 not upgraded.
Need to get 596 kB of archives.
After this operation, 1123 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
buka website resmi python di python.org
lalu Copy URL pada navigasi Download -> source code setelah itu download menggunakan curl dengan perintah
curl -O https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tar.xz
langkah selanjutnya extract file python yang telah di download tadi dengan perintah
tar -xf Python-3.8.3.tar.xz
keluar dari user root dengan perintah
exit
kemudian masuk ke directory lalu konfigurasi dengan perintah
cd Python-3.8.3
./configure --enable-optimizations
kemudian jalankan perintah
make -j 4
lalu jalankan perintah:
sudo make altinstall
langkah terakhir cek versi pyhonya dengan perintah
python3.8 -V