ubuntu

Extracting ID from file using python script?

Extracting ID from file using python script? Question: I’m trying to extract just the sequence ID from the the file in Linux server. To give you few examples TRINITY_DN0_c0_g1_i1.p1 and TRINITY_DN0_c0_g1_i3.p1 and sequence IDs. The sequence ID lengths are not same but they all start with TRINITY and ends with .p1. I tried using awk …

Total answers: 2

Pyttsx3 Ubuntu aplay:main:831 Error audio open error

Pyttsx3 Ubuntu aplay:main:831 Error audio open error Question: I’ve been trying forever to get my pyttsx code working. I am working in a Github codespace based on Linux Ubuntu. Since it is not my own I can’t access any of its settings. enter image description here I’ve ran a number of different commands to try …

Total answers: 1

Error Updating Python3 pip AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'

Error Updating Python3 pip AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms' Question: I’m having an error when installing/updating any pip module in python3. Purging and reinstalling pip and every package I can thing of hasn’t helped. Here’s the error that I get in response to running python -m pip install –upgrade pip specifically (but the …

Total answers: 3

pip3 can't download the latest tflite-runtime

pip3 can't download the latest tflite-runtime Question: The current version of tflite-runtime is 2.11.0: https://pypi.org/project/tflite-runtime/ Here is a testing for downloading the tflite-runtime to the tmp folder: mkdir -p /tmp/test cd /tmp/test echo "tflite-runtime == 2.11.0" > ./test.txt pip3 download -r ./test.txt Here is the error: ERROR: Could not find a version that satisfies the …

Total answers: 2

How to print output of pexpect consisting 'r' in next line of the terminal?

How to print output of pexpect consisting 'r' in next line of the terminal? Question: I have the follwoing code snippet from a pexpect script import pexpect import time username=<username> password=<password> child = pexpect.spawn(‘ssh <username>@192.168.1.219’,timeout=40) child.expect([‘MyUbuntu’,’$’,’#’]) child.sendline(<password>) child.expect([‘MyUbuntu’,’$’,’#’]) time.sleep(2) child.sendline(‘execute ping 192.168.1.2’) child.expect([‘MyUbuntu’,’$’,’#’]) k=child.before k=k.splitline for line in k: print(line) However it gives me an …

Total answers: 1

Docker stuck frozen in "running" status

Docker stuck frozen in "running" status Question: I have a Docker container running python code on an ubuntu 20 image, the host is also ubuntu 20. Inconsistently sometimes the container just gets stuck / freezes. Logs stop being added to the console, the docker’s status is "running". Even when I try to kill the process …

Total answers: 1

Unable to print TCPcump information using python subprocess

Unable to print TCPcump information using python subprocess Question: I wanted to process tcpdump output in a python script and so far I was able to get to this implementation from subprocess import Popen, PIPE, CalledProcessError import os import signal import time if __name__=="__main__": cmd = ["sudo","tcpdump", "-c","1000","-i","any","port","22","-n"] with Popen(cmd, stdout=PIPE, bufsize=1, universal_newlines=True) as p: …

Total answers: 1

ModuleNotFoundError: No module named 'pyomo'

ModuleNotFoundError: No module named 'pyomo' Question: I am trying to run a jupyter notebook with pyomo, but get this error when trying to import from pyomo.environ. !sapt-get install -y -qq coinor-cbc from pyomo.environ import * E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) E: Unable to acquire the dpkg frontend lock …

Total answers: 1