You are not logged in.

#1 2024-07-15 19:15:33

jiolocus
Member
Registered: 2024-07-15
Posts: 4

Error installing Python modules on Arch Linux

Hello everybody,

I'm experiencing an issue when trying to install Python modules using pip on my Arch Linux system. When I run "pip install --break-system-packages <module> | that happen for all modules "  I get the following error:

Defaulting to user installation because normal site-packages is not writeable
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 179, in exc_logging_wrapper
status = run_func(*args)
^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 324, in run
session = self.get_default_session(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/index_command.py", line 71, in get_default_session
self._session = self.enter_context(self._build_session(options))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/index_command.py", line 100, in _build_session
session = PipSession(
^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/network/session.py", line 344, in init
self.headers["User-Agent"] = user_agent()
^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/network/session.py", line 142, in user_agent
linux_distribution = distro.name(), distro.version(), distro.codename()
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 371, in version
return _distro.version(pretty, best)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 892, in version
self.lsb_release_attr("release"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1070, in lsb_release_attr
return self._lsb_release_info.get(attribute, "")
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/functools.py", line 995, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1169, in _lsb_release_info
content = self._to_str(stdout).splitlines()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1250, in _to_str
return bytestring.decode(encoding)
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'decode'
Traceback (most recent call last):
File "/usr/bin/pip", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 80, in main
return command.main(cmd_args)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 100, in main
return self._main(args)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 234, in _main
self.handle_pip_version_check(options)
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/index_command.py", line 161, in handle_pip_version_check
session = self._build_session(
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/cli/index_command.py", line 100, in _build_session
session = PipSession(
^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/network/session.py", line 344, in init
self.headers["User-Agent"] = user_agent()
^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_internal/network/session.py", line 142, in user_agent
linux_distribution = distro.name(), distro.version(), distro.codename()
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 371, in version
return _distro.version(pretty, best)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 892, in version
self.lsb_release_attr("release"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1070, in lsb_release_attr
return self._lsb_release_info.get(attribute, "")
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/functools.py", line 995, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1169, in _lsb_release_info
content = self._to_str(stdout).splitlines()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1250, in _to_str
return bytestring.decode(encoding)
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'decode'

I've tried reinstalling pip and Python and using python virtual env , but the issue persists and in past "2 days " there was no probleme until i did update my system . I'm running Arch Linux with Python 3.12.4 Has anyone else encountered this issue? Any help or guidance would be greatly appreciated.

System details:

    Arch Linux (up-to-date)
    Python 3.12.4
    pip version: 24.1.2
    lsb_release -a

LSB Version:	n/a
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a

Thank you for your time, and I look forward to hearing from you!

Last edited by jiolocus (2024-07-16 16:47:32)

Offline

#2 2024-07-16 15:27:51

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,446

Re: Error installing Python modules on Arch Linux

Don't use [ b ] tags in your title. Please edit your original post and remove those tags.

Don't use pip outside of a Python virtual environment, and only use it if the module isn't available using the preferred way of using pacman with the official repos and the AUR (or if you want to sandbox a homegrown Python app you're building).

Offline

#3 2024-07-16 16:19:45

tresa13077
Member
Registered: 2024-07-16
Posts: 1

Re: Error installing Python modules on Arch Linux

hello , im experiencing the same problem, which started after I updated my system. I've also tried using  Python environment, but I'm still getting the same error output as Jiolocus has.

Offline

#4 2024-07-16 16:39:36

SpierMooN
Member
Registered: 2024-07-16
Posts: 1

Re: Error installing Python modules on Arch Linux

Hi everyone,I'm new here and I'm desperate for help. I've been struggling with the same error as jiolocus when trying to install Python modules using pip on my Arch Linux system. The error message is identical, and I've tried all the same solutions, including reinstalling pip and Python, and using a Python virtual environment. But nothing seems to work!
I've been using Arch Linux for a while now, and I've never had any issues with pip until I updated my system a few days ago. Now, I'm stuck and I don't know what to do.
Has anyone else encountered this issue? Is there a solution that I'm missing? I'd really appreciate any help or guidance you can offer.
To be honest, I'm at my wit's end. I've been thinking about reinstalling Arch or even switching to Debian, which I've heard is a great distro for programmers. Has anyone had a similar experience? Should I take the plunge and try a new distro? Any advice would be  appreciated!

Offline

#5 2024-07-16 17:00:01

jiolocus
Member
Registered: 2024-07-15
Posts: 4

Re: Error installing Python modules on Arch Linux

twelveeighty wrote:

Don't use [ b ] tags in your title. Please edit your original post and remove those tags.

Don't use pip outside of a Python virtual environment, and only use it if the module isn't available using the preferred way of using pacman with the official repos and the AUR (or if you want to sandbox a homegrown Python app you're building).

Thanks to twelveeighty and everyone . but I've noticed that pip isn't included when I set up a Python virtual environment.

└─$ python -m venv env
┌──(jiolocus-@-LR5yJw2Kl32Iw3zaaMA2lqE)-[~]--[17:51:14]
└─$ source env/bin/activate
(env) ┌──(jiolocus-@-LR5yJw2Kl32Iw3zaaMA2lqE)-[~]--[17:51:24]
└─$ ls env/bin/
 activate   activate.csh   activate.fish   Activate.ps1   python   python3   python3.12
(env) ┌──(jiolocus-@-LR5yJw2Kl32Iw3zaaMA2lqE)-[~]--[17:51:32]
└─$ tree env/
env/
├── bin
│   ├── activate
│   ├── activate.csh
│   ├── activate.fish
│   ├── Activate.ps1
│   ├── python -> /usr/bin/python
│   ├── python3 -> python
│   └── python3.12 -> python
├── include
│   └── python3.12
├── lib
│   └── python3.12
│       └── site-packages
├── lib64 -> lib
└── pyvenv.cfg

8 directories, 8 files
(env) ┌──(jiolocus-@-LR5yJw2Kl32Iw3zaaMA2lqE)-[~]--[17:52:17]
└─$ which pip
/usr/bin/pip
(env) ┌──(jiolocus-@-LR5yJw2Kl32Iw3zaaMA2lqE)-[~]--[17:52:40]
└─$python -m ensurepip
ERROR: Exception:
Traceback (most recent call last):
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/cli/req_command.py", line 245, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/commands/install.py", line 324, in run
    session = self.get_default_session(options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/cli/req_command.py", line 95, in get_default_session
    self._session = self.enter_context(self._build_session(options))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/cli/req_command.py", line 122, in _build_session
    session = PipSession(
              ^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/network/session.py", line 342, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_internal/network/session.py", line 140, in user_agent
    linux_distribution = distro.name(), distro.version(), distro.codename()
                                        ^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_vendor/distro/distro.py", line 367, in version
    return _distro.version(pretty, best)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_vendor/distro/distro.py", line 888, in version
    self.lsb_release_attr("release"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_vendor/distro/distro.py", line 1066, in lsb_release_attr
    return self._lsb_release_info.get(attribute, "")
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_vendor/distro/distro.py", line 1165, in _lsb_release_info
    content = self._to_str(stdout).splitlines()
              ^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpo7qrazkm/pip-24.0-py3-none-any.whl/pip/_vendor/distro/distro.py", line 1246, in _to_str
    return bytestring.decode(encoding)
           ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'decode'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.12/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/ensurepip/__init__.py", line 284, in _main
    return _bootstrap(
           ^^^^^^^^^^^
  File "/usr/lib/python3.12/ensurepip/__init__.py", line 200, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/ensurepip/__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'returncode'

As you may have noticed, I also ran into the same issue when trying to install a module within the virtual environment

Offline

#6 2024-07-16 18:17:10

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,405
Website

Re: Error installing Python modules on Arch Linux

Running the venv creation in verbose mode (-v) might shed some light as to why pip isn't included, but since your OP mentions running 'pip install --break-system-packages', it'll probably point to broken system packages, so let's start there.

# pacman -Qkk >/dev/null

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2024-07-16 19:37:18

jiolocus
Member
Registered: 2024-07-15
Posts: 4

Re: Error installing Python modules on Arch Linux

here it output of commad "pacman -Qkk >/dev/null" :

└─$ pacman -Qkk >/dev/null | tee info
warning: audit: /etc/libaudit.conf (failed to calculate SHA256 checksum)
warning: audit: /etc/audit/audisp-filter.conf (failed to calculate SHA256 checksum)
warning: audit: /etc/audit/audisp-remote.conf (failed to calculate SHA256 checksum)
warning: audit: /etc/audit/zos-remote.conf (failed to calculate SHA256 checksum)
warning: audit: /etc/audit/plugins.d/af_unix.conf (Permission denied)
warning: audit: /etc/audit/plugins.d/au-remote.conf (Permission denied)
warning: audit: /etc/audit/plugins.d/audispd-zos-remote.conf (Permission denied)
warning: audit: /etc/audit/plugins.d/filter.conf (Permission denied)
warning: audit: /etc/audit/plugins.d/syslog.conf (Permission denied)
warning: audit: /usr/share/factory/etc/libaudit.conf (failed to calculate SHA256 checksum)
warning: audit: /usr/share/factory/etc/audit/audisp-filter.conf (failed to calculate SHA256 checksum)
warning: audit: /usr/share/factory/etc/audit/audisp-remote.conf (failed to calculate SHA256 checksum)
warning: audit: /usr/share/factory/etc/audit/zos-remote.conf (failed to calculate SHA256 checksum)
warning: audit: /usr/share/factory/etc/audit/plugins.d/af_unix.conf (Permission denied)
warning: audit: /usr/share/factory/etc/audit/plugins.d/au-remote.conf (Permission denied)
warning: audit: /usr/share/factory/etc/audit/plugins.d/audispd-zos-remote.conf (Permission denied)
warning: audit: /usr/share/factory/etc/audit/plugins.d/filter.conf (Permission denied)
warning: audit: /usr/share/factory/etc/audit/plugins.d/syslog.conf (Permission denied)
warning: bind: /etc/named.conf (failed to calculate SHA256 checksum)
warning: bind: /var/named/127.0.0.zone (Permission denied)
warning: bind: /var/named/localhost.ip6.zone (Permission denied)
warning: bind: /var/named/localhost.zone (Permission denied)
warning: dbus: /usr/lib/dbus-1.0/dbus-daemon-launch-helper (failed to calculate SHA256 checksum)
warning: filesystem: /etc/crypttab (failed to calculate SHA256 checksum)
warning: filesystem: /etc/gshadow (failed to calculate SHA256 checksum)
warning: filesystem: /etc/resolv.conf (File type mismatch)
warning: filesystem: /etc/shadow (failed to calculate SHA256 checksum)
warning: filesystem: /root (Permissions mismatch)
warning: filesystem: /usr/share/factory/etc/crypttab (failed to calculate SHA256 checksum)
warning: filesystem: /usr/share/factory/etc/gshadow (failed to calculate SHA256 checksum)
warning: filesystem: /usr/share/factory/etc/shadow (failed to calculate SHA256 checksum)
warning: intel-ucode: /boot/intel-ucode.img (Permissions mismatch)
warning: intel-ucode: /boot/intel-ucode.img (Modification time mismatch)
warning: java-runtime-common: /usr/lib/jvm/default (Symlink path mismatch)
warning: java-runtime-common: /usr/lib/jvm/default (Modification time mismatch)
warning: java-runtime-common: /usr/lib/jvm/default-runtime (Symlink path mismatch)
warning: java-runtime-common: /usr/lib/jvm/default-runtime (Modification time mismatch)
warning: libutempter: /usr/lib/utempter/utempter (GID mismatch)
warning: libutempter: /usr/lib/utempter/utempter (Permissions mismatch)
warning: libvirt: /etc/libvirt/nwfilter/allow-arp.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-dhcp-server.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-dhcp.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-dhcpv6-server.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-dhcpv6.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-incoming-ipv4.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-incoming-ipv6.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-ipv4.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/allow-ipv6.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/clean-traffic-gateway.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/clean-traffic.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-arp-ip-spoofing.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-arp-mac-spoofing.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-arp-spoofing.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-ip-multicast.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-ip-spoofing.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-ipv6-multicast.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-ipv6-spoofing.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-mac-broadcast.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-mac-spoofing.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-other-l2-traffic.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/no-other-rarp-traffic.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/qemu-announce-self-rarp.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/nwfilter/qemu-announce-self.xml (failed to calculate SHA256 checksum)
warning: libvirt: /etc/libvirt/qemu/networks/default.xml (failed to calculate SHA256 checksum)
warning: nodejs-nopt: /usr/bin/nopt (Permissions mismatch)
warning: novnc: /usr/share/doc/novnc/API-internal.md (Permission denied)
warning: novnc: /usr/share/doc/novnc/API.md (Permission denied)
warning: novnc: /usr/share/doc/novnc/EMBEDDING.md (Permission denied)
warning: novnc: /usr/share/doc/novnc/LIBRARY.md (Permission denied)
warning: novnc: /usr/share/doc/novnc/flash_policy.txt (Permission denied)
warning: novnc: /usr/share/doc/novnc/links (Permission denied)
warning: novnc: /usr/share/doc/novnc/notes (Permission denied)
warning: novnc: /usr/share/doc/novnc/novnc_proxy.1 (Permission denied)
warning: novnc: /usr/share/doc/novnc/rfb_notes (Permission denied)
warning: novnc: /usr/share/doc/novnc/rfbproto-3.3.pdf (Permission denied)
warning: novnc: /usr/share/doc/novnc/rfbproto-3.7.pdf (Permission denied)
warning: novnc: /usr/share/doc/novnc/rfbproto-3.8.pdf (Permission denied)
warning: openssh: /usr/lib/ssh/ssh-keysign (failed to calculate SHA256 checksum)
warning: python: /usr/lib/python3.12/subprocess.py (Modification time mismatch)
warning: python: /usr/lib/python3.12/subprocess.py (Size mismatch)
warning: python: /usr/lib/python3.12/subprocess.py (SHA256 checksum mismatch)
warning: python: /usr/lib/python3.12/__pycache__/subprocess.cpython-312.pyc (Modification time mismatch)
warning: python: /usr/lib/python3.12/__pycache__/subprocess.cpython-312.pyc (Size mismatch)
warning: python: /usr/lib/python3.12/__pycache__/subprocess.cpython-312.pyc (SHA256 checksum mismatch)
warning: shadow: /etc/default/useradd (failed to calculate SHA256 checksum)
warning: shadow: /usr/bin/groupmems (GID mismatch)
warning: shadow: /usr/bin/groupmems (Permissions mismatch)
warning: shadow: /usr/bin/groupmems (failed to calculate SHA256 checksum)
warning: sudo: /etc/sudoers (failed to calculate SHA256 checksum)
warning: systemd: /var/log/journal (GID mismatch)
warning: ufw: /etc/ufw/after.init (failed to calculate SHA256 checksum)
warning: ufw: /etc/ufw/before.init (failed to calculate SHA256 checksum)
warning: ufw: /usr/share/ufw/iptables/after.rules (failed to calculate SHA256 checksum)
warning: ufw: /usr/share/ufw/iptables/after6.rules (failed to calculate SHA256 checksum)
warning: ufw: /usr/share/ufw/iptables/before.rules (failed to calculate SHA256 checksum)
warning: ufw: /usr/share/ufw/iptables/before6.rules (failed to calculate SHA256 checksum)
warning: ufw: /usr/share/ufw/iptables/user.rules (failed to calculate SHA256 checksum)
warning: ufw: /usr/share/ufw/iptables/user6.rules (failed to calculate SHA256 checksum)
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (Modification time mismatch)
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (Size mismatch)
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (SHA256 checksum mismatch)
warning: waydroid: /usr/lib/waydroid/tools/helpers/net.py (Modification time mismatch)
warning: waydroid: /usr/lib/waydroid/tools/helpers/net.py (Size mismatch)
warning: waydroid: /usr/lib/waydroid/tools/helpers/net.py (SHA256 checksum mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/128x128/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/16x16/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/24x24/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/32x32/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/48x48/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/64x64/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.actions.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.applicationsmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.clock.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.directorymenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.launcher.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.pager.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.separator.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.showdesktop.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.systray.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.tasklist.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/96x96/apps/org.xfce.panel.windowmenu.png (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.actions.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.applicationsmenu.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.clock.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.directorymenu.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.launcher.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.pager.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.separator.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.showdesktop.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.systray.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.tasklist.svg (Modification time mismatch)
warning: xfce4-panel: /usr/share/icons/hicolor/scalable/apps/org.xfce.panel.windowmenu.svg (Modification time mismatch)

and here it s pip output verbose mode:

(myenv) ┌──(jiolocus-@-LR5yJw2Kl32Iw3zaaMA2lqE)-[~]--[20:30:22]
└─$ pip --verbose  install django
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.

    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
  File "/usr/bin/pip", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 80, in main
    return command.main(cmd_args)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 100, in main
    return self._main(args)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 234, in _main
    self.handle_pip_version_check(options)
  File "/usr/lib/python3.12/site-packages/pip/_internal/cli/index_command.py", line 161, in handle_pip_version_check
    session = self._build_session(
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_internal/cli/index_command.py", line 100, in _build_session
    session = PipSession(
              ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_internal/network/session.py", line 344, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_internal/network/session.py", line 142, in user_agent
    linux_distribution = distro.name(), distro.version(), distro.codename()
                                        ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 371, in version
    return _distro.version(pretty, best)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 892, in version
    self.lsb_release_attr("release"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1070, in lsb_release_attr
    return self._lsb_release_info.get(attribute, "")
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1169, in _lsb_release_info
    content = self._to_str(stdout).splitlines()
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py", line 1250, in _to_str
    return bytestring.decode(encoding)
           ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'decode'

I'm not an expert, but I've observed that all error messages seem to originate from two specific locations: usr/lib/python3.12/site-packages/pip/_internal/cli/base_command.py and usr/lib/python3.12/site-packages/pip/_vendor/distro/distro.py

Offline

#8 2024-07-16 21:03:02

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

Re: Error installing Python modules on Arch Linux

warning: python: /usr/lib/python3.12/subprocess.py (Modification time mismatch)
warning: python: /usr/lib/python3.12/subprocess.py (Size mismatch)
warning: python: /usr/lib/python3.12/subprocess.py (SHA256 checksum mismatch)
warning: python: /usr/lib/python3.12/__pycache__/subprocess.cpython-312.pyc (Modification time mismatch)
warning: python: /usr/lib/python3.12/__pycache__/subprocess.cpython-312.pyc (Size mismatch)
warning: python: /usr/lib/python3.12/__pycache__/subprocess.cpython-312.pyc (SHA256 checksum mismatch)
warning: shadow: /etc/default/useradd (failed to calculate SHA256 checksum)
  File "/usr/lib/python3.12/ensurepip/__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode

Offline

#9 2024-07-17 15:43:31

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,446

Re: Error installing Python modules on Arch Linux

Post all the commands you used to create the venv. "which pip" MUST resolve to $HOME/[..]/myenv/bin/pip (NOT /usr/bin/pip) from inside the venv, otherwise something's really messed up. Likely caused by the files seth mentioned as identified by pacman.

Last edited by twelveeighty (2024-07-17 15:45:13)

Offline

#10 2024-07-17 20:17:35

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

Re: Error installing Python modules on Arch Linux

Offline

#11 2024-07-18 20:52:42

jiolocus
Member
Registered: 2024-07-15
Posts: 4

Re: Error installing Python modules on Arch Linux

Thanks to everyone who responded. I was able to resolve the issue by backing up my packages using pip list, then deleting the /usr/lib/pythonX.Y/site-packages/ directory, and finally reinstalling Python with sudo pacman -S python. This not only reinstalled Python but also restored all necessary Python packages in the system.

Offline

#12 2024-07-18 21:25:59

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

Re: Error installing Python modules on Arch Linux

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#13 2024-07-19 00:25:23

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,446

Re: Error installing Python modules on Arch Linux

@seth: in post #5, OP uses "which" to see the full path to the pip command from inside the venv, and it was /usr/bin/pip, which is bad; it should resolve to the pip executable inside the venv itself.

Offline

Board footer

Powered by FluxBB