Tagged: command

Python: idle: no python-exec wrapped executable found in /usr/lib/python-exec

Python IDLE

IDLE is Python’s Integrated Development and Learning Environment where it allows programmers to easily write Python code. It's like a shell, you can execute a single statement or create/execute a Python script.

If you see below error message when you try to run IDLE, it's most likely you are missing tk USE flag for python.

idle: no python-exec wrapped executable found in /usr/lib/python-exec

To check if you are missing the tk USE flag, first check the python version:$ eselect python list Available Python interpreters, in order of preference: [1] python3.8 [2] python3.9 (fallback)

Also, check the system configuration file, /etc/python-exec/python-exec.conf, for python version:

FILE /etc/python-exec/python-exec.conf
... python3.8

Then, execute emerge with the following flags to see if tk USE flag was enabled originally. In below case, tk is not enabled since it's -tk.# emerge -pve world | grep -i dev-lang/python-3.8 [ebuild R ] dev-lang/python-3.8.8:3.8::gentoo USE="gdbm ipv6 ncurses readline sqlite ssl xml -bluetooth -build -examples -hardened (-libressl) -test -tk -verify-sig -wininst" 0 KiB

Disclaimer:
The information in this site is the result of my researches on the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

To enable the flag, you need to re-run emerge with the tk flag.# USE=tk emerge -a dev-lang/python:3.8

After successful update, check if it's enabled by running the same command: # emerge -pve world | grep -i dev-lang/python-3.8 [ebuild R ] dev-lang/python-3.8.8:3.8::gentoo USE="gdbm ipv6 ncurses readline sqlite ssl tk xml -bluetooth -build -examples -hardened (-libressl) -test -verify-sig -wininst" 0 KiB

That's all!
-gibb

Getting Sound Working From VirtualBox Clients

I got the sound working on my new system (Dell Precision 3640 Tower) with Gentoo after following the steps in Getting Sound (ALSA) Working on Gentoo. However, I couldn't get through from any of VirtualBox clients (Window$10, Manjaro Linux, or Ubuntu)

Some advices on the internet were to change the settings for Host Audio Driver and Audio Controller options on the VirtualBox host side. I tried all combination but couldn't get it working.

Disclaimer:
The information in this site is the result of my researches on the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

PulseAudio:

PulseAudio is a general purpose sound server intended to run as a middleware between applications and ALSA. I never needed to install PulseAudio to get the sound working before, so I followed the Gentoo Wiki: PulseAudio.

Kernel Update & Installation:

The Gentoo Wiki: PulseAudio shows which kernel options to turn on using make menuconfig and recompiling the kernel. # cd /usr/src/linux # make menuconfig # make && make modules_install ... # make install ... # grub-mkconfig -o /boot/grub/grub.cfg ...

After rebooting, make sure that the kernel version is updated by uname -r:# uname-v #5 SMP Fri Duc 18 14:46:23 EST 2020

Then, install pulseaudio:# emerge --ask media-sound/pulse

USE flags:

Once pulseaudio is installed, enable the system to support pulseaudio for some applications by updating /etc/portage/make.conf:

FILE /etc/portage/make.conf
USE="... pulseaudio ..."

Then update the system:# emerge --ask --changed-use --deep @world

ALSA Plugin:

ALSA needs to be configured to output to PulseAudio by default:# emerge --ask media-plugins/alsa-plugins

After following the above steps, the next time VirtualBox is started, the sound should be enabled from a client OS.

That's all!
-gibb

Updated: Python Modules

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Python Modules for i3pystatus:

With a fresh install, I seem to have issues with properly starting i3pystatus in both my workstation and VirtualBox guest. The following statement to execute i3pystatus in the i3wm config file no longer seem to be working. So, after a lot of googling, I found a solution that worked for me:... bar { # Below statement used to work before but this now gives following error message: # Traceback (most recent call last): # File ".../pystatusconfig.py", line 1, in # from i3pystatus import Status # ModuleNotFoundError: No module name 'i3pystatus' # # status_command python3 -c ~/.config/i3/pystatusconfig.py # # But after switching to below statement, it runs without above error message. status_command i3pystatus -c ~/.config/i3/pystatusconfig.py ...

pyalsaaudio:

Then, I needed to install alsaaudio python module for the volume control to work in addition to aforementioned colour, netifaces, and psutil: $ pip install --user colour \ netifaces \ psutil \ pyalsaaudio

CpuUsage: TypeError:

After above issues have been taken care of, and restarting i3pystatus, another error pops up. This time, it was something about a format issue for CpuUsage. The exact error message was this "CpuUsage: TypeError: format() missing 1 required positional argument: 'format_string'". I stumbled upon this one before and couldn't figure out even after googling. I copied the same statements as others but still got the error. Then I learned that there was an issue opened for this or something similar in enkore/i3pystatus. According to this thread, there is a fix for it and applied to the source code, but mine didn't get that fix for some reasons. So, I manually fixed it.

The target file is ~/.local/lib/python3.8/site-packages/i3pystatus/cpu_usage.py. In this file, at line 88, a string "format_string=" needs to be removed. ... # At the line 88, the "format_string=" string needs to be removed. # string = self.formatter.format(format_string=self.format_all, string = self.formatter.format(self.format_all, ...

That's all!
-gibb

Updated: NVIDIA Drivers

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

NVIDIA Drivers:

The new video card installed on DELL Precision 3640 Tower is Nvidia Quadro P620, and the driver for this card is included in x11-drivers/nvidia-drivers. So, no need to download drivers from the NVIDIA website. Just run and follow the instruction of post installation at Gentoo Wiki: NVIDIA/nvidia-drivers : # emerge --ask x11-drivers/nvidia-drivers

That's all!
-gibb

Updated: X11

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

X11:

After installing x11-base/xorg-drivers and x11-base/xorg-server, X11 may exit with errors complaining, missing twm, xterm, xclock. When that happens, installing these components will fix the issue and hopefully X11 will start.# emerge --ask twm xterm xclock

That's all!
-gibb