Cara Membuat Virtual Environment (venv) di Ubuntu Server

  1. Install Python dan venv
    python3 --version
    sudo apt update
    sudo apt install python3 python3-venv python3-pip
    1. Buat Virtual Environment
    cd /path/to/your/project
    python3 -m venv venvbaru
    1. Aktifkan Virtual Environment
    source venvbaru/bin/activate

    akan berubah menjadi:

    (venv) user@server:~/path/to/project$
    1. Instal paket Python yang diinginkan
    pip install nama-paket
    1. Menonaktifkan Virtual Environment
    deactivate

    Done. Semoga bermanfaat!

    Loading

    Leave a Reply

    Your email address will not be published. Required fields are marked *