포스트

2026-05-04-W1_mon VS Code Setting, Concept of venv(Virtual Environment)

Python Study : Environment Setup

Requirements

  • VS Code (Visual Studio Code) : Do not install SandBox Version (Do not install from Microsoft Store!)
  • Python 3.xx.xx (Optional)
  • Anaconda 3 (Python Package)

    Setup

    Create folder

    1
    
    mkdir <folder_name>
    

    Go to New folder

    1
    2
    3
    
    cd <folder_name>
    # if you want to go high level folder
    cd ..
    

    Create virture environment

    # first venv is create command
    # second venv is venv name 
    python -m venv .venv
    

    Activate

    1
    
    .venv\Scripts\activate
    
1
source .venv/bin/activate # mac/linux

Check python Version

1
python --version

Deactivate

1
deactivate

Note

  • Keep venv folder outside of OneDrive
  • venv folder should not be pushed to GitHub
  • if you want to remove some folders or files use these commands
    1
    
    rm <file_name>
    
1
remove-item -recurse -force <folder_name>
1
rm -rf <folder_name> # mac/linux
  • if you want to move some folders or files use these commands
    1
    
    mv <file(folder)_name> <target_path>\
    
    1
    
    mv <file(folder)_name> <target_path>/ # mac/linux
    
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.

인기 태그