fsniraj
  • Blogs
  • Courses
  • Account
  • Blogs
  • Courses
  • Account
Privacy PolicyTerms of Service

© 2024 Full Stack Niraj. All Rights Reserved.

How to Setup Python Project For The First Time

Niraj Dhungana
Niraj Dhungana•July 10, 2025
Share:
How to Setup Python Project For The First Time

I am a JavaScript developer learning to build projects with python. While using Node JS everything is so easy just install Node, use npm init command and now you can install all the packages that you need but when it comes to python it's not that easy. But not after reading this post, here is how I approach project setup for the first time starting with python.

  1. Install Python
  2. Create a Virtual Environment
  3. Activate the Virtual Environment
  4. Install Packages in the Virtual Environment
  5. Verify Package Installation
  6. Deactivate the Virtual Environment

Create a Virtual Environment

Navigate to Your Project Directory: Open Terminal and navigate to the directory where you want to create your virtual environment.

terminal
cd /path/to/your/project

Use the venv module to create a virtual environment. Replace venv with your desired name

terminal
python -m venv venv
// or python3 in some version of MAC
python3 -m venv venv

Activate the Virtual Environment

Once the virtual environment is created, you can activate it with the source command:

terminal
source venv/bin/activate

Verify Activation:

To confirm the environment is active, check the Python executable path:

terminal
which python

or

terminal
which python3

It should point to the Python executable inside your venv folder, like /path/to/your/project/venv/bin/python

Install Packages in the Virtual Environment

Install Packages Using pip: While the virtual environment is active, you can install packages using pip. For example, to install sympy:

terminal
pip install sympy

Verify Package Installation: You can list installed packages with:

terminal
pip list

Deactivate the Virtual Environment

When you are done working in the virtual environment, you can deactivate it with:

terminal
deactivate