envycontrol icon indicating copy to clipboard operation
envycontrol copied to clipboard

Solved - [BUG] Envycontrol not working after Python 3.12 update

Open luciorgomes opened this issue 1 year ago • 10 comments

Describe the bug Envycontrol don't run after python 3.12 update on Endeavour (Arch based)

To Reproduce Steps to reproduce the behavior:

  1. Run sudo envycontrol -s nvidia
  2. Error: Traceback (most recent call last): File "/usr/lib/python3.12/importlib/metadata/init.py", line 397, in from_name return next(cls.discover(name=name)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/envycontrol", line 33, in sys.exit(load_entry_point('envycontrol==3.4.0', 'console_scripts', 'envycontrol')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/envycontrol", line 22, in importlib_load_entry_point for entry_point in distribution(dist_name).entry_points ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/importlib/metadata/init.py", line 862, in distribution return Distribution.from_name(distribution_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/importlib/metadata/init.py", line 399, in from_name raise PackageNotFoundError(name) importlib.metadata.PackageNotFoundError: No package metadata was found for envycontrol

System Information:

  • Model: Dell G15
  • Distro: EndeavourOs
  • Kernel: 6.7.9-zen1-1-zen
  • DE/WM and Display Manager (if applicable): KDE 6 SDDM
  • EnvyControl version: 3.4.0
  • Nvidia driver version: 550.76-2
  • lspci output:
0000:00:00.0 Host bridge: Intel Corporation Device a719 (rev 01)
0000:00:01.0 PCI bridge: Intel Corporation Device a70d (rev 01)
0000:00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-S UHD Graphics (rev 04)
0000:00:04.0 Signal processing controller: Intel Corporation Raptor Lake Dynamic Platform and Thermal Framework Processor Participant (rev 01)
0000:00:0e.0 RAID bus controller: Intel Corporation Volume Management Device NVMe RAID Controller Intel Corporation
0000:00:12.0 Serial controller: Intel Corporation Device 7a78 (rev 11)
0000:00:14.0 USB controller: Intel Corporation Raptor Lake USB 3.2 Gen 2x2 (20 Gb/s) XHCI Host Controller (rev 11)
0000:00:14.2 RAM memory: Intel Corporation Raptor Lake-S PCH Shared SRAM (rev 11)
0000:00:14.3 Network controller: Intel Corporation Raptor Lake-S PCH CNVi WiFi (rev 11)
0000:00:15.0 Serial bus controller: Intel Corporation Raptor Lake Serial IO I2C Host Controller #0 (rev 11)
0000:00:15.1 Serial bus controller: Intel Corporation Raptor Lake Serial IO I2C Host Controller #1 (rev 11)
0000:00:16.0 Communication controller: Intel Corporation Raptor Lake CSME HECI #1 (rev 11)
0000:00:1c.0 PCI bridge: Intel Corporation Device 7a3e (rev 11)
0000:00:1f.0 ISA bridge: Intel Corporation Device 7a0c (rev 11)
0000:00:1f.4 SMBus: Intel Corporation Raptor Lake-S PCH SMBus Controller (rev 11)
0000:00:1f.5 Serial bus controller: Intel Corporation Raptor Lake SPI (flash) Controller (rev 11)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] (rev a1)
0000:01:00.1 Audio device: NVIDIA Corporation Device 2291 (rev a1)
0000:02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller (rev 15)
10000:e0:1b.0 System peripheral: Intel Corporation RST VMD Managed Controller
10000:e0:1b.4 PCI bridge: Intel Corporation Raptor Lake PCI Express Root Port #21 (rev 11)
10000:e1:00.0 Non-Volatile memory controller: ADATA Technology Co., Ltd. SM2P41C3 NVMe SSD (DRAM-less) (rev 03)

luciorgomes avatar Apr 27 '24 14:04 luciorgomes

Idem on Garuda Linux with KDE 6/ Kernel 6.8.7-zen1-1-zen

overwrite00 avatar Apr 27 '24 18:04 overwrite00

Arch Linux changed something on their side, will take a look and thanks for reporting!

bayasdev avatar Apr 27 '24 18:04 bayasdev

@luciorgomes @overwrite00 if you uninstall envycontrol, clear cache and install it again does it work?

I remember experiencing a similar issue each time Arch Linux did a major Python upgrade.

bayasdev avatar Apr 27 '24 18:04 bayasdev

@luciorgomes @overwrite00 if you uninstall envycontrol, clear cache and install it again does it work?

I remember experiencing a similar issue each time Arch Linux did a major Python upgrade.

I removed envycontrol, cleared cache and installed again. Upon reboot everything works perfectly. Thanks and great work 😉 💪

overwrite00 avatar Apr 27 '24 19:04 overwrite00

@luciorgomes @overwrite00 if you uninstall envycontrol, clear cache and install it again does it work?

I remember experiencing a similar issue each time Arch Linux did a major Python upgrade.

I removed envycontrol, cleared cache and installed again. Upon reboot everything works perfectly. Thanks and great work 😉 💪

Amazing @overwrite00, do you mind sharing the exact commands in order to update the README? 😉

bayasdev avatar Apr 27 '24 19:04 bayasdev

No problem. The commands to type in your terminal are the following:

sudo pacman -R envycontrol #uninstall envycontrol
sudo pacman -Sc #clear package cache
sudo pacman -Sy envycontrol #install envycontrol

Procedure performed successfully on Garuda Linux.

overwrite00 avatar Apr 27 '24 19:04 overwrite00

Thanks @bayasdev @overwrite00 ! It's ok now.

luciorgomes avatar Apr 27 '24 21:04 luciorgomes

on vanilla arch and endeavouros you need to rm -r $HOME/.cache/paru/clone/envycontrol && sudo rm /usr/bin/{netaddr , tqdm} after sudo pacman -Rns envycontrol as it can cause : error: failed to commit transaction (conflicting files) python-netaddr: /usr/bin/netaddr exists in filesystem python-tqdm: /usr/bin/tqdm exists in filesystem Errors occurred, no packages were upgraded. also there is no reason for pacman -Sc NOTE :it is a problem with allmost every python 3.12 pkgs on arch @bayasdev

meduk0 avatar Apr 30 '24 18:04 meduk0

You can also do this to fix it: paru -S --rebuild envycontrol.

This problem happens with AUR packages depending on python after major python version updates occur. I have a pacman hook to warn me of these cases, but I kind of wish there was a graphics card switcher not written in python for this reason (eg in shell, rust, go, etc).

At least with envycontrol (because it's not service based) these problems won't break my system like they did with optimus-manager

kpa28-git avatar Apr 30 '24 19:04 kpa28-git

FYI - for future readers - I tend to use a Python venv for all software that I rely upon and not the system installation. I.e., I do not install any pip packages globally.

PDM (https://pdm-project.org/) can help deal with duplicate package installs across Python apps to minimize filesystem footprint.

Just realize that the root user will need its own cache as well as your login user. So not perfect (yet), but it helps a lot.

Kudos to @bayasdev for his experience with the matrix of variables people are exposed to!

klmcwhirter avatar May 10 '24 21:05 klmcwhirter

Closing due to inactivity

bayasdev avatar Jul 02 '24 17:07 bayasdev