venv vs conda
Virtual environment options in PyCharm
- venv
- Built into Python 3. Lightweight, no extra install. Best for pure Python projects.
- virtualenv
- Third-party, more features than venv. Supports older Python versions.
- Conda
- From Anaconda. Handles non-Python dependencies. Best for data science.
- pipenv
- Combines pip and virtualenv. Good for web projects.
Create venv
Create a virtual environment in PyCharm on Windows
- 1
New Project method (easiest)
File → New Project. In the interpreter section, select "New environment using Virtualenv". Choose the base Python version. Click Create.
- 2
Existing project method
File → Settings → Project → Python Interpreter → gear icon → Add Interpreter → Virtualenv Environment → New environment.
- 3
Or create from terminal
# Create venv in project folder:PS> python -m venv .venv# Activate:PS> .venv\Scripts\activate# Install packages:(.venv) PS> pip install requests pandas
FAQ
venv questions
PyCharm venv not activating in terminal on Windows
PowerShell may block script execution. Fix: in PyCharm terminal run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. Then activate with .venv\Scripts\activate. Or use cmd.exe instead: .venv\Scripts\activate.bat.