This post is more for my own purposes but if you’re reading this I hope it helps 🙂 I’m a very basic Python user and I’ve battled a bit on how to keep Python updated; I use Anaconda plus have various packages installed via pip. Below is the process I use to keep Anaconda and Pip installed packages updated in Microsoft Windows.
Note: the below process will resolve any ‘Consider using the --user
option or check the permissions’ error that you may receive.
Time needed: 15 minutes.
Follow the instructions below to update Python Anaconda and pip packages in Windows.
- Open Anaconda Powershell Prompt
Search Windows for ‘Anaconda Powershell Prompt’ and click ‘run as Administrator’.
- Update Anaconda
Enter the following code into the prompt and click enter on your keyboard:
conda update --all
Wait for the updates to complete. - Update pip packages
Enter
python
into the prompt and click enter on your keyboard.
Enter the following code into the prompt and click enter on your keyboard:import pkg_resources
from subprocess import call
packages = [dist.project_name for dist in pkg_resources.working_set]
call("pip install --upgrade --user " + ' '.join(packages), shell=True)
You’ll soon need to click the enter key again and then you will wait awhile for the updates to complete.
Leave a ReplyCancel reply