You are not logged in.

#1 2023-02-23 09:04:06

mindbound
Member
Registered: 2011-07-30
Posts: 46

[Solved] Error installing Python AUR packages

When installing some Python packages from AUR (such as python-hydra-core and python-transformers), I am getting the following error during the wheel creation process (same error for all afflicted packages):

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 375, in main
    built = build_call(
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 208, in build_package
    out = _build(isolation, builder, outdir, distribution, config_settings, skip_dependency_check)
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 147, in _build
    return _build_in_current_env(builder, outdir, distribution, config_settings, skip_dependency_check)
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 127, in _build_in_current_env
    missing = builder.check_dependencies(distribution)
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 369, in check_dependencies
    return {u for d in dependencies for u in check_dependency(d)}
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 369, in <setcomp>
    return {u for d in dependencies for u in check_dependency(d)}
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 185, in check_dependency
    yield from check_dependency(other_req_string, ancestral_req_strings + (normalised_req_string,), req.extras)
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 185, in check_dependency
    yield from check_dependency(other_req_string, ancestral_req_strings + (normalised_req_string,), req.extras)
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 185, in check_dependency
    yield from check_dependency(other_req_string, ancestral_req_strings + (normalised_req_string,), req.extras)
  [Previous line repeated 1 more time]
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 179, in check_dependency
    if req.specifier and not req.specifier.contains(dist.version, prereleases=True):
  File "/usr/lib/python3.10/site-packages/packaging/specifiers.py", line 902, in contains
    item = Version(item)
  File "/usr/lib/python3.10/site-packages/packaging/version.py", line 195, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

Typical solutions, like cleaning the build cache or uninstalling the old version of the package, haven't helped. Please advise. TIA.

Last edited by mindbound (2023-02-23 16:24:57)

Offline

#2 2023-02-23 10:40:37

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,840

Re: [Solved] Error installing Python AUR packages

python-hydra-core was updated yesterday and builds fine here after changing default java version to 11* .

Try again with that version, post full build log if it still fails.


* Had it set to java-8 for some tests with another aur package .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-02-23 10:43:15

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

I don't think there's anything wrong with any of the packages (another one that fails to build for me is python-aesara, which I know builds correctly on another Arch machine), this seems to be some kind of problem with my Python installation. All of these packages fail to build with exactly the same traceback.

Last edited by mindbound (2023-02-23 10:47:29)

Offline

#4 2023-02-23 11:00:22

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,840

Re: [Solved] Error installing Python AUR packages

The traceback could be merely a symptom while the real cause is in an earlier part of the log .

It does suggest something is wrong with your python install, but there's not enough info about your system to do more then guess what causes it.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2023-02-23 11:05:27

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

That seems to be the entire log. The full output of

yay -S pkglog

(another package that fails to build in this exact way) is as follows:

$ yay -S pkglog 
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  pkglog-1.20-1

:: (1/1) Downloaded PKGBUILD: pkglog
  1 pkglog                           (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (1/1) Parsing SRCINFO: pkglog
==> Making package: pkglog 1.20-1 (Thu 23 Feb 2023 01:01:49 PM EET)
==> Retrieving sources...
  -> Downloading pkglog-1.20.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  8994    0  8994    0     0  15651      0 --:--:-- --:--:-- --:--:-- 15651
==> Validating source files with sha1sums...
    pkglog-1.20.tar.gz ... Passed
==> Making package: pkglog 1.20-1 (Thu 23 Feb 2023 01:01:51 PM EET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found pkglog-1.20.tar.gz
==> Validating source files with sha1sums...
    pkglog-1.20.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting pkglog-1.20.tar.gz with bsdtar
==> Sources are ready.
==> Making package: pkglog 1.20-1 (Thu 23 Feb 2023 01:01:52 PM EET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
* Getting build dependencies for wheel...
running egg_info
creating pkglog.egg-info
writing pkglog.egg-info/PKG-INFO
writing dependency_links to pkglog.egg-info/dependency_links.txt
writing entry points to pkglog.egg-info/entry_points.txt
writing requirements to pkglog.egg-info/requires.txt
writing top-level names to pkglog.egg-info/top_level.txt
writing manifest file 'pkglog.egg-info/SOURCES.txt'
reading manifest file 'pkglog.egg-info/SOURCES.txt'
writing manifest file 'pkglog.egg-info/SOURCES.txt'

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 375, in main
    built = build_call(
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 208, in build_package
    out = _build(isolation, builder, outdir, distribution, config_settings, skip_dependency_check)
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 147, in _build
    return _build_in_current_env(builder, outdir, distribution, config_settings, skip_dependency_check)
  File "/usr/lib/python3.10/site-packages/build/__main__.py", line 127, in _build_in_current_env
    missing = builder.check_dependencies(distribution)
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 369, in check_dependencies
    return {u for d in dependencies for u in check_dependency(d)}
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 369, in <setcomp>
    return {u for d in dependencies for u in check_dependency(d)}
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 185, in check_dependency
    yield from check_dependency(other_req_string, ancestral_req_strings + (normalised_req_string,), req.extras)
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 185, in check_dependency
    yield from check_dependency(other_req_string, ancestral_req_strings + (normalised_req_string,), req.extras)
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 185, in check_dependency
    yield from check_dependency(other_req_string, ancestral_req_strings + (normalised_req_string,), req.extras)
  [Previous line repeated 1 more time]
  File "/usr/lib/python3.10/site-packages/build/__init__.py", line 179, in check_dependency
    if req.specifier and not req.specifier.contains(dist.version, prereleases=True):
  File "/usr/lib/python3.10/site-packages/packaging/specifiers.py", line 902, in contains
    item = Version(item)
  File "/usr/lib/python3.10/site-packages/packaging/version.py", line 195, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

ERROR expected string or bytes-like object
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: pkglog

Offline

#6 2023-02-23 11:27:11

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,840

Re: [Solved] Error installing Python AUR packages

It does seem to abort very soon in the build process.

What is the output of

$ pacman -Qkk python-packaging
$ type python

?

When was your last pacman -Syu (if unsure, search in /var/log/pacman.log ) .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2023-02-23 11:31:31

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

$ pacman -Qkk python-packaging
python-packaging: 53 total files, 0 altered files

$ type python
python is /usr/bin/python

Last pacman -Syu was this morning, less than 5 h ago.

Offline

#8 2023-02-23 11:38:53

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,840

Re: [Solved] Error installing Python AUR packages

Ok, then i'm almost out of ideas.

Try building one of those packages with makepkg to verify yay is not involved in the problem .
(I don't think it is this time, but it's better to verify)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2023-02-23 11:45:10

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

It's not yay, I have already tried building the packages with makepkg. Re-checked just now, getting the same results.

Offline

#10 2023-02-23 12:21:26

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [Solved] Error installing Python AUR packages

Moving to AUR issues.

Offline

#11 2023-02-23 12:44:19

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: [Solved] Error installing Python AUR packages

PIP or Conda getting in the way?

pip list
sudo pip list
printenv

Can you https://wiki.archlinux.org/title/Develo … ean_chroot ?

Offline

#12 2023-02-23 13:09:13

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

I can build without errors in a clean chroot.

I don't have a Conda environment active at the moment, so it's likely pip getting in the way somehow.

Last edited by mindbound (2023-02-23 13:09:55)

Offline

#13 2023-02-23 13:09:48

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: [Solved] Error installing Python AUR packages

seth wrote:

PIP or Conda getting in the way?

Offline

#14 2023-02-23 13:12:11

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

pip list

outputs 893 packages, which seems about right for my machine.

How can I start tracking down the issue?

Offline

#15 2023-02-23 13:17:05

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: [Solved] Error installing Python AUR packages

Are you using them in a virtual environment or installed them "--user"?
Because otherwise that's 893 packages too many.

Edit: https://wiki.archlinux.org/title/Python … management

Last edited by seth (2023-02-23 13:17:20)

Offline

#16 2023-02-23 13:20:37

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

Doesn't pip list also include packages installed from official repositories and AUR as well? Most of these packages have been installed from these sources instead of pip install.

Last edited by mindbound (2023-02-23 13:23:29)

Offline

#17 2023-02-23 13:40:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: [Solved] Error installing Python AUR packages

Indeed sad
That's gonna make finding collisions much harder - short of bisecting the installed packages and/or removing all pacman controlled packages and see what's left hmm

But you hadn't checked

pacman -Qkk python-build python-wheel

?

Offline

#18 2023-02-23 13:41:30

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

$ pacman -Qkk python-build python-wheel

python-build: 95 total files, 0 altered files
python-wheel: 58 total files, 0 altered files

Offline

#19 2023-02-23 13:54:17

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: [Solved] Error installing Python AUR packages

What about

pacman -Qm `pacman -Qqo /usr/lib/python3.10/site-packages/`
pacman -Qkk `pacman -Qqo /usr/lib/python3.10/site-packages/`

Offline

#20 2023-02-23 14:06:59

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

pacman -Qm `pacman -Qqo /usr/lib/python3.10/site-packages/`

STDOUT: https://pastebin.com/fxaMsuqr

pacman -Qkk `pacman -Qqo /usr/lib/python3.10/site-packages/`

STDOUT: https://pastebin.com/Q1kq7tq2
STDERR: https://pastebin.com/WL94fJj2

Offline

#21 2023-02-23 14:17:33

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Offline

#22 2023-02-23 14:21:38

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

I reinstalled them (both from the official repos) and there are no more messages about them in the STDERR. The build issues remain the same.

Offline

#23 2023-02-23 15:52:40

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

More investigation results: the build fails specifically during python -m build dependency check (and doesn't fail when the -x/--skip-dependency-check flag is passed).

Should I just go through the _deps list from the package's setup.py and reinstall the dependency packages one by one or is there a more correct way to try and resolve this?

Offline

#24 2023-02-23 16:03:38

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,714

Re: [Solved] Error installing Python AUR packages

the build fails specifically during python -m build dependency check

Yes, the backtrace says that. Ultimately because

TypeError: expected string or bytes-like object

but unless a package in "pip list" has a freakish version … seems to be a thing, though: https://github.com/pypa/build/issues/558

Offline

#25 2023-02-23 16:11:47

mindbound
Member
Registered: 2011-07-30
Posts: 46

Re: [Solved] Error installing Python AUR packages

By hacking the packaging module to output the version before trying to regex search it, it seems that one package is reporting None as the version, which of course can't be parsed and could be the source of the problem.

Now, to figure out how to output the name of that package.

Edit: FIXED. The package in question was typing_extensions that for some reason didn't correctly report its version. I reinstalled it and the build issues seem to be gone. Thanks to everyone who helped me with this.

Last edited by mindbound (2023-02-23 16:25:36)

Offline

Board footer

Powered by FluxBB