'just installed Python, getting WinError 32 for any libraries I try to install

I just installed Python 3.10 on my work machine. I went to pip install pandas and got a Win32 error on a temp file within the AppData Temp Folder.I have tried with other libraries and same error. Tried to uninstall and reinstall and got the same error. Also, tried to run CMD as admin and no better.

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: C:\\Users\\user\\AppData\\Local\\Temp\\tmp1b78532k


Solution 1:[1]

Restart your computer, Upgrade pip and try installing pandas with Unofficial Windows Binaries for Python Extension Packages or

pip install --user <package_name> --no-cache-dir

Also take a look at PermissionError: [WinError 32] The process cannot access the file because it is being used by another process.

Solution 2:[2]

Try to restart your machiene to stop the process accessing that file or delete the file itself. This should be safe because it is temporary. And are you sure that you pip3.10 installed?

Solution 3:[3]

  1. Uninstall python

  2. Delete the Lib folder in C:/User/user1/AppData/Local/Programs/Python/Python39 and C:/User/user1/AppData/Local/Programs/Python/Python310

  3. Re-install python.

Solution 4:[4]

you have very probably installed python as administrator therefore your account does not have permissions to do what you want. Best solution is to get winpython portable and put it in a work folder.

Solution 5:[5]

The best way is to:

  1. Uninstall python3
  2. Reinstall python3 when you open Command Prompt as 'administrator'.

Refer to here for further details and configs. https://syntaxfix.com/question/5180/pip-install-access-denied-on-windows

Solution 6:[6]

Restart your computer to stop the currently running process that is using the temp file. After restart clear the temps files on your system:

  1. Press windows key + R
  2. Type %temp% hit enter
  3. Select all temps files and delete them

You can then reinstall python and run the pip command and install your desired libraries.

Solution 7:[7]

First, restart your system - chances are that will stop whatever is accessing the temp file already. You could also delete said temp file afterwards if you want to be sure. If that fails, reinstalling Python altogether as admin should fix it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David Kariuki
Solution 2 NoBlockhit
Solution 3 Kovy Jacob
Solution 4 user3732793
Solution 5 TRIPL9
Solution 6 Jasmeet
Solution 7 Azathoth