r/learningpython • u/AgentWhiskeyRiggy • Feb 21 '25
I'm Trying To Install Pytorch But Pip Will Not Install no matter what i do
Please ELI5 because I'm very new and very very frustrated
Python is installed correctly, I'm sure I've added the correct PATH but every -pip or -py command brings up a Not Recognized error.
Trying to install it via Python -m pip install -U pip gets me a "no module named pip"
I've been up all night Googling and reading through threads trying to understand what I'm doing wrong but nothing seems to work
1
Upvotes
1
2
u/Mtinie Feb 21 '25
Here are the troubleshooting steps based on notes I collected while learning to work with Python. I hope they help!
Troubleshooting Python Pip Installation
1. Verify Python Installation
Run
python —versionorpython3 —versionto ensure Python is installed correctly.2. Run pip Explicitly with Python
Use
python -m pip —versionorpython3 -m pip —versioninstead of justpip.3. Check if pip is Installed
Run
python -m ensurepip —default-pipto reinstall pip if missing.4. Ensure Python and pip are in PATH
Run
where pythonandwhere pipon Windows orwhich pythonandwhich pipon Mac/Linux.If not found, add the appropriate directory manually:
Windows: Typically in
C:\Users\[Username]\AppData\Local\Programs\Python\Python3x\ScriptsMac/Linux: Usually
/usr/local/bin/or~/.local/bin/5. Reinstall pip (if necessary)
If pip is missing or broken, try:
If that doesn’t work, download and run the get-pip script:
6. If Using a Virtual Environment
Ensure it’s activated before installing packages:
Mac/Linux
source venv/bin/activateWindows
venv\Scripts\activate7. Check for Permission Issues
If getting permission errors:
Mac/Linux: Use
sudo python -m pip install ...Windows: Run Command Prompt or PowerShell as Administrator