The error message 'pip' is not recognized as an internal or external command means that your computer doesn't know where to find the pip command. This usually happens when Python or pip is not installed correctly, or the installation path is not added to your system's environment variables.
Here’s how to fix it step-by-step:
Solution 1: Ensure Python and pip are Installed
-
Check if Python is installed:
- Open Command Prompt and type:
python --version
- If Python is installed, you'll see the version number (e.g.,
Python 3.9.7). If not, download and install Python.
-
Check if pip is installed:
- Type:
pip --version
- If pip is installed, you'll see the version number. If not, it’s usually included with Python 3.x installations.
Solution 2: Add Python and pip to System PATH
If Python and pip are installed but not recognized, you need to add them to your system's PATH:
-
Find Python's installation directory:
-
Add Python to PATH:
-
Restart Command Prompt and try running pip again.
Solution 3: Use Python's Full Path
If adding to PATH doesn’t work, you can call pip using Python’s full path:
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\python.exe -m pip install requests beautifulsoup4
Replace the path with your Python installation directory.
Solution 4: Reinstall Python (if nothing works)
If all else fails, uninstall Python and reinstall it, making sure to check the box that says "Add Python to PATH" during installation.
After Fixing pip
Once pip is recognized, run your original command again:
pip install requests beautifulsoup4
Let me know if you still face issues!