Creating a virtual environment in PyCharm can be completed by following the following steps:
Open PyCharm and enter your project.
Select "File" -> "Settings" (Windows/Linux) or "PyCharm" -> "Preferences" (Mac) in the menu bar.
In the settings window, expand the "Project: your_project_name" node and select "Python Interpreter".
In the drop-down menu in the upper right corner, select "Show All…".
Click the "Add" icon to add a new virtual environment.
In the pop-up window, select "Virtualenv environment" and click "OK".
In the pop-up dialog box, select the location of the virtual environment and the interpreter version, and then click "OK".
PyCharm will automatically create a virtual environment and set it as the interpreter of the current project.
After creating a virtual environment, you can use this virtual environment to install the dependency packages required for the project without affecting other projects in the system.
Hope these steps can help you!