Pamac doesn't use the default python path

Hello, I noticed that during an update with pamac, it didn’t use the first entry of python path available and the update failed because in the python environement pamac chosed, I didn’t have the build module :

Building python-pyrsistent...
==> Making package: python-pyrsistent 0.20.0-7 (mar. 11 mars 2025 09:00:40)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found pyrsistent-0.20.0.tar.gz
  -> Found python3.13.patch
==> Validating source files with sha512sums...
    pyrsistent-0.20.0.tar.gz ... Passed
    python3.13.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting pyrsistent-0.20.0.tar.gz with bsdtar
==> Starting prepare()...
patching file pvectorcmodule.c
==> Removing existing $pkgdir/ directory...
==> Starting build()...
/home/nleconte/miniforge3/bin/python: No module named build
==> ERROR: A failure occurred in build().
    Aborting...

Instead of choosing the default and first entry (/usr/bin/python), it selected the last one (/home/nleconte/miniforge3/bin/python) which did not have the build module, so the update failed.

In my current environment, I didn’t activate any particular python environment, so I expect pamac to choose the first one and not the last one :

whereis python                                                                                                                                                                           
python: /usr/bin/python /home/nleconte/miniforge3/bin/python /usr/share/man/man1/python.1.gz

The command I used to make the update was : pamac update -a

I tried the following : PYTHONPATH=/usr/bin/python pamac update -a
But it failed because then pamac asks to elevate as root, as the PYTHONPATH value is lost.

I finally tried this to avoid letting pamac handle the elevation to root and to avoid losing the value I manually provided for PYTHONPATH : sudo PYTHONPATH=/usr/bin/python pamac update -a
The update was finally OK.

I think somehow, it could be handled better by pamac. Just use the first path (=default one) in the python path instead of the last one.

What you are trying to do is not valid maintenance and is unsupported.

Pamac uses libalpm and it is not designed to update in user path.

If you are using python packages you should maintain using pip in a virtual environment.

I repeat Pamac is designed to update system packages.

Even given the fact that you can somehow trick pamac into installing into your home - using sudo will effectively wreck permissions inside your home.

1 Like

Welcome to the Manjaro community

As a new or infrequent forum user, please take some time to familiarise yourself with Forum requirements, and the many ways to use the forum to your benefit:


Update Announcements

The Update Announcements contain important information and a Known Issues and Solutions section that should generally be checked before posting a request for support.

System Information

Output of this command (formatted according to forum requirements) may be useful for those wishing to help:

inxi --filter --verbosity=8

or the short form:

inxi -zv8

Be prepared to provide more information and outputs from other commands whenever asked.

Required reading
Resources

Regards.

Hello @linux-aarhus that’s exactly my point.

I’m NOT trying to use a virtual environment, and I am purely updating system packages (python-pyrsistent), but pamac tries to use a virtual environment during the build of this system package whereas it should not, and should rather use the python from the system itself.

I had to “trick” pamac because of this undesired behavior.

This is a custom buildscript from AUR.

If this misbehaves - it is matter for the maintainer - or it is your local configuration - please check your environment variables.

That said - I tested the build and - pamac build as expected on my workstation.

Console build output
 $ pamac build python-pyrsistent
Preparing...
Checking python-pyrsistent dependencies...
Resolving dependencies...
Checking inter-conflicts...

To install (5):
  python-sortedcontainers  2.4.0-7    (Required By: python-pyrsistent)  extra  
  python-hypothesis        6.127.9-1  (Required By: python-pyrsistent)  extra  924,1 kB
  python-pluggy            1.5.0-3    (Required By: python-pyrsistent)  extra  45,8 kB
  python-iniconfig         2.0.0-6    (Required By: python-pyrsistent)  extra  14,1 kB
  python-pytest            1:8.3.5-1  (Required By: python-pyrsistent)  extra  723,7 kB
To build (1):
  python-pyrsistent        0.20.0-6                                     AUR

Total download size: 1,7 MB
Total installed size: 9,7 MB

Edit build files : [e] 
Apply transaction ? [e/y/N] y

Cloning python-pyrsistent build files...
Generating python-pyrsistent information...
==== AUTHENTICATING FOR org.manjaro.pamac.commit ====
Authentication is required to install, update, or remove packages
Authenticating as: FH (fh)
Password: 
==== AUTHENTICATION COMPLETE ====
Download of python-iniconfig (2.0.0-6) started                                                                                       
Download of python-iniconfig (2.0.0-6) finished                                                                                      
Download of python-pluggy (1.5.0-3) finished                                                                                         
Download of python-pytest (1:8.3.5-1) finished                                                                                       
Download of python-hypothesis (6.127.9-1) finished                                                                                   
Checking keyring...                                                                                                             [5/5]
Checking integrity...                                                                                                           [5/5]
Loading packages files...                                                                                                       [5/5]
Checking file conflicts...                                                                                                      [5/5]
Checking available disk space...                                                                                                [5/5]
Installing python-sortedcontainers (2.4.0-7)...                                                                                 [1/5]
Installing python-hypothesis (6.127.9-1)...                                                                                     [2/5]
Installing python-pluggy (1.5.0-3)...                                                                                           [3/5]
Installing python-iniconfig (2.0.0-6)...                                                                                        [4/5]
Installing python-pytest (1:8.3.5-1)...                                                                                         [5/5]
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                                                                  [1/2]
Refreshing PackageKit...                                                                                                        [2/2]

Building python-pyrsistent...
==> Making package: python-pyrsistent 0.20.0-7 (tir 11 mar 2025 11:59:49 CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading pyrsistent-0.20.0.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  101k  100  101k    0     0  1889k      0 --:--:-- --:--:-- --:--:-- 1889k
  -> Downloading python3.13.patch...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1212  100  1212    0     0   4357      0 --:--:-- --:--:-- --:--:--  4359
==> Validating source files with sha512sums...
    pyrsistent-0.20.0.tar.gz ... Passed
    python3.13.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting pyrsistent-0.20.0.tar.gz with bsdtar
==> Starting prepare()...
patching file pvectorcmodule.c
==> Starting build()...
* Getting build dependencies for wheel...
No `name` configuration, performing automatic discovery
/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
running egg_info
writing pyrsistent.egg-info/PKG-INFO
writing dependency_links to pyrsistent.egg-info/dependency_links.txt
writing top-level names to pyrsistent.egg-info/top_level.txt
reading manifest file 'pyrsistent.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.mit'
writing manifest file 'pyrsistent.egg-info/SOURCES.txt'
* Building wheel...
/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build/lib.linux-x86_64-cpython-313
copying _pyrsistent_version.py -> build/lib.linux-x86_64-cpython-313
creating build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_pclass.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_checked_types.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_precord.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_field_common.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_pdeque.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_pmap.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/typing.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_transformations.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_toolz.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_pvector.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_immutable.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_pset.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_helpers.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/__init__.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_plist.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/_pbag.py -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/__init__.pyi -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/typing.pyi -> build/lib.linux-x86_64-cpython-313/pyrsistent
copying pyrsistent/py.typed -> build/lib.linux-x86_64-cpython-313/pyrsistent
running build_ext
building 'pvectorc' extension
creating build/temp.linux-x86_64-cpython-313
gcc -march=znver3 -mtune=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fPIC -I/usr/include/python3.13 -c pvectorcmodule.c -o build/temp.linux-x86_64-cpython-313/pvectorcmodule.o
gcc -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -march=znver3 -mtune=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection build/temp.linux-x86_64-cpython-313/pvectorcmodule.o -L/usr/lib -o build/lib.linux-x86_64-cpython-313/pvectorc.cpython-313-x86_64-linux-gnu.so
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_pclass.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_checked_types.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_precord.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_field_common.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_pdeque.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_pmap.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/typing.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_transformations.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/__init__.pyi -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_toolz.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_pvector.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_immutable.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_pset.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_helpers.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/py.typed -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/__init__.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_plist.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/typing.pyi -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/pyrsistent/_pbag.py -> build/bdist.linux-x86_64/wheel/./pyrsistent
copying build/lib.linux-x86_64-cpython-313/_pyrsistent_version.py -> build/bdist.linux-x86_64/wheel/.
copying build/lib.linux-x86_64-cpython-313/pvectorc.cpython-313-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/.
running install_egg_info
running egg_info
writing pyrsistent.egg-info/PKG-INFO
writing dependency_links to pyrsistent.egg-info/dependency_links.txt
writing top-level names to pyrsistent.egg-info/top_level.txt
reading manifest file 'pyrsistent.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.mit'
writing manifest file 'pyrsistent.egg-info/SOURCES.txt'
Copying pyrsistent.egg-info to build/bdist.linux-x86_64/wheel/./pyrsistent-0.20.0-py3.13.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/pyrsistent-0.20.0.dist-info/WHEEL
creating '/var/tmp/pamac-build-fh/python-pyrsistent/src/pyrsistent-0.20.0/dist/.tmp-6a1vciqj/pyrsistent-0.20.0-cp313-cp313-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding '_pyrsistent_version.py'
adding 'pvectorc.cpython-313-x86_64-linux-gnu.so'
adding 'pyrsistent/__init__.py'
adding 'pyrsistent/__init__.pyi'
adding 'pyrsistent/_checked_types.py'
adding 'pyrsistent/_field_common.py'
adding 'pyrsistent/_helpers.py'
adding 'pyrsistent/_immutable.py'
adding 'pyrsistent/_pbag.py'
adding 'pyrsistent/_pclass.py'
adding 'pyrsistent/_pdeque.py'
adding 'pyrsistent/_plist.py'
adding 'pyrsistent/_pmap.py'
adding 'pyrsistent/_precord.py'
adding 'pyrsistent/_pset.py'
adding 'pyrsistent/_pvector.py'
adding 'pyrsistent/_toolz.py'
adding 'pyrsistent/_transformations.py'
adding 'pyrsistent/py.typed'
adding 'pyrsistent/typing.py'
adding 'pyrsistent/typing.pyi'
adding 'pyrsistent-0.20.0.dist-info/LICENSE.mit'
adding 'pyrsistent-0.20.0.dist-info/METADATA'
adding 'pyrsistent-0.20.0.dist-info/WHEEL'
adding 'pyrsistent-0.20.0.dist-info/top_level.txt'
adding 'pyrsistent-0.20.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built pyrsistent-0.20.0-cp313-cp313-linux_x86_64.whl
==> Entering fakeroot environment...
==> Starting package()...
==> 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 "python-pyrsistent"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: python-pyrsistent 0.20.0-7 (tir 11 mar 2025 11:59:51 CET)
==> Cleaning up...

Checking keyring...                                                                                                             [1/1]
Checking integrity...                                                                                                           [1/1]
Loading packages files...                                                                                                       [1/1]
Checking file conflicts...                                                                                                      [1/1]
Checking available disk space...                                                                                                [1/1]
Installing python-pyrsistent (0.20.0-7)...                                                                                      [1/1]
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                                                                  [1/2]
Refreshing PackageKit...                                                                                                        [2/2]
Transaction successfully finished.
1 Like

Ok, thank you.

It seems linked to my env somehow, as when I simply type python, it is not using the good one. I had to run the following to disable the “undesired behavior” that was caused by conda :

conda config --set auto_activate_base false

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.