ခေါင်းစဉ် 2 / 5 20 မိနစ်

Python Development Environment Setup (Python Development Environment ပြင်ဆင်ခြင်း)

Python Programming ကို စတင်ရေးသားနိုင်ရန်အတွက် Python Interpreter နှင့် Code Editor တို့ကို ကွန်ပျူတာတွင် မှန်ကန်စွာ ထည့်သွင်းထားရန် လိုအပ်ပါသည်။ ဤသင်ခန်းစာတွင် Python ကို Download ပြုလုပ်ခြင်း၊ Install ပြုလုပ်ခြင်း၊ VS Code ကို Install လုပ်ခြင်း၊ Python Extension ထည့်သွင်းခြင်းနှင့် Python Program များကို စတင် Run နိုင်သည့် Development Environment ကို အဆင့်လိုက် ပြင်ဆင်သွားပါမည်။


1. Development Environment ဆိုတာဘာလဲ?

Programming ရေးသားနိုင်ရန် အသုံးပြုသော Software များနှင့် Tools များကို စုစည်း၍ Development Environment ဟု ခေါ်ပါသည်။

Python Program တစ်ခု ရေးသားရန် အနည်းဆုံး အောက်ပါ Software (၂) ခု လိုအပ်ပါသည်။

Python Interpreter
Code Editor (Visual Studio Code)

Python Interpreter သည် Python Code များကို Execute ပြုလုပ်ပေးပြီး Code Editor သည် Code များကို ရေးသားရန် အသုံးပြုသော Software ဖြစ်ပါသည်။

2. Python ကို Download ပြုလုပ်ခြင်း
Python ကို Python Foundation ၏ Official Website မှ Download ပြုလုပ်သင့်ပါသည်။

Website
https://www.python.org

Website ထဲသို့ ဝင်ရောက်ပြီး Operating System (Windows / macOS / Linux) အလိုက် သင့်တော်သော Version ကို Download ပြုလုပ်နိုင်ပါသည်။
Python Version အသစ်များကို အသုံးပြုခြင်းသည် Security နှင့် Performance အတွက် ပိုမိုကောင်းမွန်ပါသည်။

3. Python Install ပြုလုပ်ခြင်း

Download ပြုလုပ်ထားသော Installer ကို Run လုပ်ပါ။

Install မလုပ်မီ

Add Python to PATH

ဆိုသော Checkbox ကို အရင်အမှန်ခြစ်ရန် အရေးကြီးပါသည်။

ထို့နောက်
Install Now

ကိုနှိပ်ပြီး Installation ပြီးဆုံးသည်အထိ စောင့်ဆိုင်းပါ။
Installation အောင်မြင်ပါက Python Interpreter ကို Command Prompt မှ အသုံးပြုနိုင်ပြီ ဖြစ်ပါသည်။

4. Add Python to PATH ဆိုတာဘာလဲ?

PATH ဆိုသည်မှာ Operating System မှ Program များကို ဘယ်နေရာတွင် Install လုပ်ထားသည်ကို သိရှိစေရန် အသုံးပြုသော Environment Variable ဖြစ်ပါသည်။

Add Python to PATH ကို အမှန်မခြစ်ခဲ့ပါက

python is not recognized as an internal or external command

ကဲ့သို့ Error များ ဖြစ်ပေါ်နိုင်ပါသည်။

ထို့ကြောင့် Installation ပြုလုပ်စဉ်တွင် Add Python to PATH ကို အမြဲရွေးချယ်သင့်ပါသည်။


5. Python Installation ကို စစ်ဆေးခြင်း

Command Prompt (CMD) သို့မဟုတ် Terminal ကို ဖွင့်ပါ။

အောက်ပါ Command ကို ရိုက်ထည့်ပါ။

python --version
သို့မဟုတ်
python -V

Output ဥပမာ

Python 3.13.2

Version Number ပေါ်လာပါက Python Installation အောင်မြင်ပါသည်။

6. pip ဆိုတာဘာလဲ?
Python တွင် Library များ Install ပြုလုပ်ရန် အသုံးပြုသော Package Manager ကို pip ဟု ခေါ်ပါသည်။

pip Version ကို စစ်ဆေးရန်

pip --version
ဥပမာ
pip 25.0

pip ကို အသုံးပြုပြီး အခြား Library များကို လွယ်ကူစွာ Install ပြုလုပ်နိုင်ပါသည်။

ဥပမာ
pip install requests

7. Visual Studio Code Install ပြုလုပ်ခြင်း
Python ကို ရေးသားရန် အသုံးများသော Code Editor တစ်ခုမှာ Visual Studio Code (VS Code) ဖြစ်ပါသည်။

VS Code ကို Download ပြုလုပ်ရန်
https://code.visualstudio.com

Install ပြီးပါက VS Code ကို ဖွင့်ပါ။

8. Python Extension ထည့်သွင်းခြင်း

VS Code ကို ဖွင့်ပြီး

Extensions (Ctrl + Shift + X) ကိုနှိပ်ပါ။

Search Box တွင်
Python
ဟု ရိုက်ထည့်ပါ။
Microsoft မှ ထုတ်လုပ်ထားသော Python Extension ကို Install ပြုလုပ်ပါ။

Extension ထည့်သွင်းပြီးပါက

9. Python File တစ်ခု ဖန်တီးခြင်း

Folder အသစ်တစ်ခု ဖန်တီးပါ။
ဥပမာ
PythonBasic

Folder ကို VS Code ဖြင့် ဖွင့်ပါ။

ထို့နောက်
File အသစ်တစ်ခု ဖန်တီးပြီး

hello.py

ဟု အမည်ပေးပါ။

Python File များ၏ Extension သည်

.py ဖြစ်ပါသည်။

Syntax Highlight
IntelliSense (Code Suggestion)
Auto Completion
Debugging
Code Formatting

စသည့် Feature များကို အသုံးပြုနိုင်ပါသည်။

10. Python Program ကို Run ပြုလုပ်ခြင်း

Terminal ကို ဖွင့်ပါ။

အောက်ပါ Command ကို အသုံးပြုပါ။

python hello.py

Program အလုပ်လုပ်ပြီး Result ကို Terminal တွင် ပြသပေးမည် ဖြစ်ပါသည်။

11. Beginner များ အများဆုံးတွေ့ရသော Error များ
Python Command မသိသော Error
'python' is not recognized...

ဖြေရှင်းနည်း

Add Python to PATH ကို စစ်ဆေးပါ။
Python ကို Restart Install ပြုလုပ်ပါ။
Python Extension မရှိခြင်း

Python File ကို ဖွင့်သော်လည်း Syntax Color မပေါ်ပါက Python Extension ကို Install ပြုလုပ်ထားခြင်း ရှိ/မရှိ စစ်ဆေးပါ။

Wrong Python Interpreter

VS Code ၏ အောက်ညာဘက်တွင် Python Version ကို နှိပ်ပြီး မှန်ကန်သော Interpreter ကို ရွေးချယ်ပါ။

ဒီသင်ခန်းစာမှ သိထားသင့်သော အချက်များ
Development Environment ဆိုတာဘာလဲ။
Python ကို Official Website မှ Download ပြုလုပ်နိုင်သည်။
Install ပြုလုပ်စဉ် Add Python to PATH ကို အမှန်ခြစ်ရန် လိုအပ်သည်။
Python Installation ကို python --version ဖြင့် စစ်ဆေးနိုင်သည်။
pip သည် Python Package Manager ဖြစ်သည်။
VS Code နှင့် Python Extension ကို Install ပြုလုပ်ရမည်။
.py Extension ဖြင့် Python File များကို ဖန်တီးပြီး python filename.py ဖြင့် Run ပြုလုပ်နိုင်သည်။

Progress သိမ်းလိုပါက Login ဝင်ပါ။ Login မဝင်ဘဲလည်း ခေါင်းစဉ်အားလုံးကို လေ့လာနိုင်ပါသည်။