An issue where I'm unable to build any python based packages from the AUR

I’m currently on EOS with the KDE desktop. I’ve used this install since over a month and everything was going fine when suddenly I was unable to update/install any python based packages from the AUR.

Everytime I do so, I get the following error:

==> Making package: auto-cpufreq 1.9.6-1 (Sunday 25 September 2022 01:23:40 PM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
Traceback (most recent call last):
  File "/home/priyanshu/.cache/yay/auto-cpufreq/src/auto-cpufreq-1.9.6/setup.py", line 18, in <module>
    setup(
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 86, in setup
    _install_setup_requires(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 75, in _install_setup_requires
    dist = MinimalDistribution(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 57, in __init__
    super().__init__(filtered)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 475, in __init__
    for ep in metadata.entry_points(group='distutils.setup_keywords'):
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
    return SelectableGroups.load(eps).select(**params)
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 459, in load
    ordered = sorted(eps, key=by_group)
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
    eps = itertools.chain.from_iterable(
  File "/usr/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
    k = key(element)
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name
    return self._name_from_stem(stem) or super()._normalized_name
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 622, in _normalized_name
    return Prepared.normalize(self.name)
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 871, in normalize
    return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File "/usr/lib/python3.10/re.py", line 209, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: auto-cpufreq

Screenshot_20220925_133501

And it’s not isolated to just auto-cpufreq, there are many packages that I simply am unable to update: like python-proton-client, epy-git, etc; the only thing common between them being they’re python based and it’s causing problems during AUR updates, any help would be appreciated.

Here’s my complete system info in case needed:

System:
  Kernel: 5.19.10-arch1-1 arch: x86_64 bits: 64 Desktop: KDE Plasma v: 5.25.5
    Distro: EndeavourOS
Machine:
  Type: Laptop System: LENOVO product: 81UT v: Lenovo IdeaPad S145-15API
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0Q55722WIN
    serial: <superuser required> UEFI: LENOVO v: BUCN31WW date: 02/11/2022
Battery:
  ID-1: BAT0 charge: 8.3 Wh (26.7%) condition: 31.1/35.0 Wh (88.7%)
    volts: 7.3 min: 7.5
CPU:
  Info: dual core model: AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx
    bits: 64 type: MT MCP cache: L2: 1024 KiB
  Speed (MHz): avg: 1355 min/max: 1400/2600 cores: 1: 1223 2: 1400 3: 1400
    4: 1400
Graphics:
  Device-1: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel
  Device-2: Chicony Integrated Camera type: USB driver: uvcvideo
  Display: wayland server: X.org v: 1.21.1.4 with: Xwayland v: 22.1.3
    compositor: kwin_wayland driver: X: loaded: amdgpu unloaded: modesetting
    gpu: amdgpu resolution: 1920x1080
  OpenGL: renderer: AMD Radeon Vega 3 Graphics (raven LLVM 14.0.6 DRM 3.47
    5.19.10-arch1-1) v: 4.6 Mesa 22.1.7
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio driver: snd_hda_intel
  Device-2: AMD Family 17h/19h HD Audio driver: snd_hda_intel
  Sound Server-1: ALSA v: k5.19.10-arch1-1 running: yes
  Sound Server-2: PipeWire v: 0.3.58 running: yes
Network:
  Device-1: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter
    driver: ath10k_pci
  IF: wlan0 state: up mac: 80:30:49:87:3e:bd
Bluetooth:
  Device-1: Qualcomm Atheros type: USB driver: btusb
  Report: rfkill ID: hci0 state: up address: see --recommends
Drives:
  Local Storage: total: 238.47 GiB used: 148.54 GiB (62.3%)
  ID-1: /dev/nvme0n1 vendor: Lenovo model: UMIS RPJTJ256MEE1OWX
    size: 238.47 GiB
Partition:
  ID-1: / size: 97.49 GiB used: 61.67 GiB (63.3%) fs: ext4
    dev: /dev/nvme0n1p7
  ID-2: /boot/efi size: 300.1 MiB used: 468 KiB (0.2%) fs: vfat
    dev: /dev/nvme0n1p5
Swap:
  ID-1: swap-1 type: partition size: 7.52 GiB used: 0 KiB (0.0%)
    dev: /dev/nvme0n1p6
Sensors:
  System Temperatures: cpu: 36.8 C mobo: N/A gpu: amdgpu temp: 36.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 258 Uptime: 46m Memory: 5.67 GiB used: 2.52 GiB (44.5%)
  Shell: Zsh inxi: 3.3.21

could be some stuff in relation to the removal of python2 from arch repos?
Is your system fully updated to latest?

Yeah I spent some time dealing with some python2 stuff last night. It’s mentioned on the front page of the Arch site. The size of the issue depends on how many old apps you use i guess. Good old pacman got it sorted. :wink:
Edit: I did have to lose one application though: fslint. But it’s no big deal.

Yeah my system is completely updated, except for a few AUR packages which I’m unable to update.

I see, but the apps in question aren’t really that old I think, they received update and I was unable to update them, I had installed them a while back, a week or so. I’ll check out the arch page.

It seems to build fine on my end.

Summary: makepkg -s
$ makepkg -s 
==> Making package: auto-cpufreq 1.9.6-1 (Sun 25 Sep 2022 12:32:44 PM CEST)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Package (2)              New Version  Net Change  Download Size

community/python-click   8.1.3-1        0.89 MiB       0.15 MiB
community/python-distro  1.7.0-1        0.16 MiB       0.03 MiB

Total Download Size:   0.18 MiB
Total Installed Size:  1.05 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 python-distro-1....    31.1 KiB  67.3 KiB/s 00:00 [######################] 100%
 python-click-8.1...   154.8 KiB   261 KiB/s 00:01 [######################] 100%
 Total (2/2)           185.9 KiB   274 KiB/s 00:01 [######################] 100%
(2/2) checking keys in keyring                     [######################] 100%
(2/2) checking package integrity                   [######################] 100%
(2/2) loading package files                        [######################] 100%
(2/2) checking for file conflicts                  [######################] 100%
(2/2) checking available disk space                [######################] 100%
:: Processing package changes...
(1/2) installing python-distro                     [######################] 100%
(2/2) installing python-click                      [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Package (1)       New Version  Net Change  Download Size

extra/python-pip  22.2.2-2      15.91 MiB       2.50 MiB

Total Download Size:    2.50 MiB
Total Installed Size:  15.91 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 python-pip-22.2....     2.5 MiB  2.09 MiB/s 00:01 [######################] 100%
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing python-pip                        [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Retrieving sources...
  -> Downloading auto-cpufreq-1.9.6.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 28393    0 28393    0     0  18863      0 --:--:--  0:00:01 --:--:-- 42440
  -> Found auto-cpufreq.service
==> Validating source files with b2sums...
    auto-cpufreq-1.9.6.tar.gz ... Passed
    auto-cpufreq.service ... Passed
==> Extracting sources...
  -> Extracting auto-cpufreq-1.9.6.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
/usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
WARNING: The wheel package is not available.
WARNING: The wheel package is not available.
running build
running build_py
creating build
creating build/lib
creating build/lib/auto_cpufreq
copying auto_cpufreq/power_helper.py -> build/lib/auto_cpufreq
copying auto_cpufreq/__init__.py -> build/lib/auto_cpufreq
copying auto_cpufreq/core.py -> build/lib/auto_cpufreq
copying auto_cpufreq/tlp_stat_parser.py -> build/lib/auto_cpufreq
running egg_info
creating auto_cpufreq.egg-info
writing auto_cpufreq.egg-info/PKG-INFO
writing dependency_links to auto_cpufreq.egg-info/dependency_links.txt
writing requirements to auto_cpufreq.egg-info/requires.txt
writing top-level names to auto_cpufreq.egg-info/top_level.txt
writing manifest file 'auto_cpufreq.egg-info/SOURCES.txt'
reading manifest file 'auto_cpufreq.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'auto_cpufreq.egg-info/SOURCES.txt'
running build_scripts
creating build/scripts-3.10
copying and adjusting bin/auto-cpufreq -> build/scripts-3.10
changing mode of build/scripts-3.10/auto-cpufreq from 644 to 755
==> Entering fakeroot environment...
==> Starting package()...
/usr/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
WARNING: The wheel package is not available.
WARNING: The wheel package is not available.
running install
/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running install_lib
creating /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr
creating /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib
creating /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10
creating /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages
creating /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq
copying build/lib/auto_cpufreq/power_helper.py -> /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq
copying build/lib/auto_cpufreq/__init__.py -> /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq
copying build/lib/auto_cpufreq/core.py -> /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq
copying build/lib/auto_cpufreq/tlp_stat_parser.py -> /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq
byte-compiling /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq/power_helper.py to power_helper.cpython-310.pyc
byte-compiling /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq/__init__.py to __init__.cpython-310.pyc
byte-compiling /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq/core.py to core.cpython-310.pyc
byte-compiling /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq/tlp_stat_parser.py to tlp_stat_parser.cpython-310.pyc
writing byte-compilation script '/tmp/tmpli3aq181.py'
/usr/bin/python /tmp/tmpli3aq181.py
removing /tmp/tmpli3aq181.py
running install_egg_info
running egg_info
writing auto_cpufreq.egg-info/PKG-INFO
writing dependency_links to auto_cpufreq.egg-info/dependency_links.txt
writing requirements to auto_cpufreq.egg-info/requires.txt
writing top-level names to auto_cpufreq.egg-info/top_level.txt
reading manifest file 'auto_cpufreq.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'auto_cpufreq.egg-info/SOURCES.txt'
Copying auto_cpufreq.egg-info to /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/lib/python3.10/site-packages/auto_cpufreq-1.9.6-py3.10.egg-info
running install_scripts
creating /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/bin
copying build/scripts-3.10/auto-cpufreq -> /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/bin
changing mode of /home/pebcak/Build/auto-cpufreq/pkg/auto-cpufreq/usr/bin/auto-cpufreq to 755
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "auto-cpufreq"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: auto-cpufreq 1.9.6-1 (Sun 25 Sep 2022 12:33:22 PM CEST)

You might want to try clean-building it and see if that helps.

I tried clean building it too, with a similar error, I can’t seem to figure out what might’ve caused it.

1 Like

Seems to be the common problem, only guessing, try uninstalling and reinstalling python-regex. Have you installed anything via pip?

I haven’t installed a lot of packages through pip, but when I run “pip freeze” I can see the packages I have installed through the AUR like proton client and etc. It seems I don’t have python-regex installed at all, should I go ahead and install it?

Wont hurt anything - then try an update.

I installed it and ran an update, but I see the same error message again.

Was only a guess :smiley:

Next thing:

yay -Q | grep -i python > pypkg.txt
#Then
sudo pacman -Syu --needed --noconfirm - < pypkg.txt

Will reinstall everything that mentions python.

May have to remove aur packages from list (unsure!!!).

I’ll try that thanks, seems like it might take a while, I’ll let you know in a bit.

Python RegEx - W3Schools

https://www.w3schools.com › python › python_regex
(https://www.w3schools.com/python/python_regex.asp)

Python has a built-in package called re , which can be used to work with Regular Expressions. Import the re module: import re. RegEx in Python. When you have …

Looks like the built-in package “re” is borked. If that doesn’t work, try:

sudo pacman -Rdd python # Force uninstall
#then
sudo pacman -S python # Reinstall

Removing python2-dbus solved my problems, but you may have to lose some other components to achieve this.

I tried this, it gives an error saying target not found and mentions the packages from the pypkg.txt file

It may be aur packages in list causing problems. Try the second thing I posted.

I opened python runtime and typed “import re” and when I exited and tried again, it didn’t work, I tried force removing it too, still no change… Should I clear cache after force uninstalling?

pacman -Q|cut -f 1 -d " " | grep -i python > pypkg.txt

Will create a list of pacman packages. Other than that out of ideas, sorry :frowning:

Thanks for trying to help, the list did work but didn’t fix this issue.