I run the command:
python.exe -m pip install --upgrade pip
But when I do I get an OSError saying my access is denied.
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python312\\Lib\\site-packages\\pip\\__init__.py'
Consider using the `--user` option or check the permissions.
How can I update it safely? I have tried downloading the package online but it doesn't work and found other answers saying use sudo but it's not safe.
I run the command:
python.exe -m pip install --upgrade pip
But when I do I get an OSError saying my access is denied.
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python312\\Lib\\site-packages\\pip\\__init__.py'
Consider using the `--user` option or check the permissions.
How can I update it safely? I have tried downloading the package online but it doesn't work and found other answers saying use sudo but it's not safe.
Share Improve this question edited Feb 5 at 14:39 phd 95.1k14 gold badges158 silver badges207 bronze badges asked Feb 4 at 0:43 mdotmdot 456 bronze badges 9- 2 Please paste your error messages as code-formatted text instead of screenshots. – Anerdw Commented Feb 4 at 0:47
- 3 It sounds like you are trying to install into the global Python, which needs admin privileges. You need to either 1) create a venv, or 2) use an admin command prompt. – David Commented Feb 4 at 1:08
- 2 The first error message is not telling you to update pip; it's complaining about a missing package file and then separately giving you a boilerplate notice that there's a new pip version available. – jjc385 Commented Feb 4 at 1:09
- Do you have admin priviliedges? – Starship Commented Feb 4 at 1:38
- @Starship how do i check if i have admin privileges? – mdot Commented Feb 4 at 1:59
1 Answer
Reset to default 0Try opening your command prompt/terminal with administrator privileges