0

i was using python today and needed to update pip. I ran the standard python -m pip --upgrade install pip command as system admin but now pip can't do anything and gives a quite bizarre error message:

ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
    status = self.run(options, args)
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 253, in run
    options.use_user_site = decide_user_install(
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 604, in decide_user_install
    if site_packages_writable(root=root_path, isolated=isolated_mode):
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 548, in site_packages_writable
    return all(
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 549, in <genexpr>
    test_writable_dir(d) for d in set(get_lib_location_guesses(**kwargs))
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\filesystem.py", line 140, in test_writable_dir
    return _test_writable_dir_win(path)
  File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\filesystem.py", line 153, in _test_writable_dir_win
    fd = os.open(file, os.O_RDWR | os.O_CREAT | os.O_EXCL)
PermissionError: [Errno 13] Permission denied: 'c:\\program files (x86)\\python38-32\\Lib\\site-packages\\accesstest_deleteme_fishfingers_custard_al9l45'
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\program files (x86)\python38-32\python.exe -m pip install --upgrade pip' command.

this is the output if I run any pip updating or even just calling pip install on any package. the referenced file mentioned at the end does not seem to exist on my PC. does anyone know what it is?

PS I have tried running command prompt and PowerShell as both admin and normal user and each time get this exact error

user19273
  • 108
  • 9
  • DUPLICATE: (https://stackoverflow.com/questions/13207450/permissionerror-errno-13-in-python). Someone please mark this, as I don't have enough reputation :-( – Krishnan Shankar May 22 '20 at 18:39
  • 1
    @KrishnanShankar I have tried running in admin and it did not fix it let mr add this to the question. also this question is less about making pip work and more about figuring out what that weird file is. – user19273 May 22 '20 at 18:43
  • Does this answer your question? [PermissionError: \[Errno 13\] in python](https://stackoverflow.com/questions/13207450/permissionerror-errno-13-in-python) – 10 Rep May 22 '20 at 18:45
  • @KrishnanShankar Marked as duplicate – 10 Rep May 22 '20 at 18:45
  • This error is caused by permission issue. Seem that you do not have write access. Use `python -m pip install --upgrade --user pip` to install the package inside your account may work. – Aaron May 22 '20 at 18:47
  • 1
    @Aaron thank you that did make the odd error go away and fixed pip. however I still do not know what the purpose of the fishfinger file that pip pointed at was for. do you? – user19273 May 22 '20 at 18:52
  • seem it is write access test file. may be the part of the name randomly generated? – Aaron May 22 '20 at 19:01
  • @Aaron this seems reasonable. so it is just a file to help verify pip installed correctly and then gets deleted once used? – user19273 May 22 '20 at 19:59
  • It test whether the directory is writable. Please refer to https://github.com/pypa/pip/blob/5d6234172f0d7bd5284ac6879899b39496f1a23d/src/pip/_internal/utils/filesystem.py#L156 – Aaron May 22 '20 at 20:01

0 Answers0