You are not logged in.

#1 2022-05-14 06:51:29

Hoswoo
Member
From: United States
Registered: 2021-11-12
Posts: 13

[SOLVED] Python broken after recent update

Hello everyone, I recently ran

sudo pacman -Syu

rebooted and now I am getting a lot of Python related errors.

When I run Python3 from the shell, it shows:

Error processing line 1 of /usr/lib/python3.10/site-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.10/site.py", line 186, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored

This isn't really my main concern as it actually isn't really affecting anything, however my syntax checker for vim relies on Python3 and it is now no longer working properly.

Some of my Vim plugins are now complaining that they

Requires Vim compiled with +python3"

Syntastic is giving me the error:

No 'python3' provider found. Run :checkhealth provider

When I run :checkhealth provider I get

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - WARNING: Could not load Python 3:
    /usr/bin/python3 is Python Error processing line 1 of /usr/lib/python3.10/site-packages/distutils-precedence.pth:
    
    Traceback (most recent call last):
    File "/usr/lib/python3.10/site.py", line 186, in addpackage
    exec(line)
    File "<string>", line 1, in <module>
    AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'
    
    Remainder of file ignored
    3.10 and cannot provide Python 3.
    /usr/bin/python3.10 is Python Error processing line 1 of /usr/lib/python3.10/site-packages/distutils-precedence.pth:
    
    Traceback (most recent call last):
    File "/usr/lib/python3.10/site.py", line 186, in addpackage
    exec(line)
    File "<string>", line 1, in <module>
    AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'
    
    Remainder of file ignored
    3.10 and cannot provide Python 3.
    python3.9 not found in search path or not executable.
    python3.8 not found in search path or not executable.
    python3.7 not found in search path or not executable.
    /usr/bin/python is Python Error processing line 1 of /usr/lib/python3.10/site-packages/distutils-precedence.pth:
    
    Traceback (most recent call last):
    File "/usr/lib/python3.10/site.py", line 186, in addpackage
    exec(line)
    File "<string>", line 1, in <module>
    AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'
    
    Remainder of file ignored
    3.10 and cannot provide Python 3.
    - ADVICE:
      - See :help |provider-python| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
  - INFO: Executable: Not found

I'm not really exactly sure if these issues are due to a recent update, but they did start happening very recently after I updated, so I figured it was related to that.

Any suggestions? Is anyone running into similar issues?

Last edited by Hoswoo (2022-05-15 02:40:11)

Offline

#2 2022-05-14 10:50:39

shakedown1979
Member
Registered: 2020-04-01
Posts: 3

Re: [SOLVED] Python broken after recent update

I am seeing the same issue after a full update this morning.

Offline

#3 2022-05-14 11:26:28

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,358
Website

Re: [SOLVED] Python broken after recent update


Солідарність з Україною

Offline

#4 2022-05-14 11:43:30

shakedown1979
Member
Registered: 2020-04-01
Posts: 3

Re: [SOLVED] Python broken after recent update

A fix for me was to remove my "~/.local/python3.10" directory (i don't know why that's there, i backed it up in case it's important).

edit: duh, that's where pip installs packages for users without root access (i thought that was elsewhere). In the end doing "pip uninstall setuptools" to remove the local user copy of setup tools seemed to work ok, without wiping out my other packages. Not sure if any consequences will arise because of that, but i can install and uninstall ok. Simply updating setuptools to version 62.x didn't seem to work, even though the linked issue says version 60.1 should have the required attribute.

Last edited by shakedown1979 (2022-05-14 16:27:17)

Offline

#5 2022-05-15 02:39:56

Hoswoo
Member
From: United States
Registered: 2021-11-12
Posts: 13

Re: [SOLVED] Python broken after recent update

Thank you both of you, that solved the problem.

I ran

pip uninstall setuptools

and it fixed all of the issues I was having.

Last edited by Hoswoo (2022-05-15 02:42:03)

Offline

Board footer

Powered by FluxBB