Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Comprehensive_Python_Setup_Guide (1)

Uploaded by

akm230040
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Comprehensive_Python_Setup_Guide (1)

Uploaded by

akm230040
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Comprehensive Python Setup Guide

1. Installing Python

1. Download Python from the official website: https://www.python.org/downloads/

2. Run the installer and ensure to check the box "Add Python to PATH".

3. Verify installation by running:

python --version

2. Installing pip and Upgrading

1. Install pip and essential packages using:

python -m pip install --upgrade pip setuptools wheel

python -m pip install setuptools-rust

2. Verify pip installation with:

pip --version

3. Setting Up Virtual Environment

1. Create a virtual environment:

python -m venv myenv

2. Activate the environment:

On Windows: myenv\Scripts\activate

On Mac/Linux: source myenv/bin/activate

3. Deactivate the environment when done:

deactivate
4. Installing Libraries

Install commonly used libraries:

1. OpenCV: pip install opencv-python opencv-contrib-python

2. NumPy: pip install numpy

3. Matplotlib: pip install matplotlib

4. TensorFlow: pip install tensorflow

5. Other useful libraries:

pip install pandas scikit-learn dlib pillow

5. Adding Environment Variables

1. Add Python and Scripts folder to PATH:

C:\Users\<Your Username>\AppData\Local\Programs\Python\Python313

C:\Users\<Your Username>\AppData\Local\Programs\Python\Python313\Scripts

2. Use the command to set PATH:

setx PATH "%PATH%;<path-to-python>"

6. Navigating Directories

1. Use cd command to change directories:

cd C:\Users\<Your Username>\AppData\Local\Programs\Python\Python313

7. Testing Installations

Run the following script to test installations:


import cv2

import numpy as np

import matplotlib.pyplot as plt

import tensorflow as tf

print("OpenCV:", cv2.__version__)

print("NumPy:", np.__version__)

print("Matplotlib:", plt.__version__)

print("TensorFlow:", tf.__version__)

8. Troubleshooting Common Errors

1. If ModuleNotFoundError occurs, install the missing library:

pip install <library-name>

2. If pip is not working, reinstall it using:

python -m ensurepip

You might also like