Creating a Virtual Environment¶
Python¶
To create a virtual environment in Python, follow these steps:
-
Install
virtualenv(if not already installed):pip install virtualenv -
Navigate to your project directory:
cd your-project-directory -
Create a virtual environment:
virtualenv venv -
Activate the virtual environment:
-
On Windows:
-
On macOS/Linux:
-
Deactivate the virtual environment when done:
Node.js¶
To create a virtual environment in Node.js, you can use nvm (Node Version Manager):
-
Install
nvm(if not already installed): Follow the installation instructions from the nvm repository. -
Install a specific Node.js version:
nvm install <version> -
Use the installed version:
nvm use <version> -
Deactivate the version:
nvm deactivate