set virtualenv pycharm code example
Example 1: python virtualenv venv
python -m venv venv
Example 2: how to use existing virtual environment in pycharm
Open >> File
>> Settings(Ctrl+Alt+S)
>> Project: > Python Interpreter
>> Right side of the Browse path select location of existing venv path
>> Apply and OK.