Category "python-3.x"

future got attached to different loop

Task <Task pending name='Task-11' coro=<Queue.get() running at C:\Users\Administrator\anaconda3\lib\asyncio\queues.py:166> cb=[_release_waiter(<Futu

How can I record system audio from my speakers using Python?

I looking for script to record system audio, not microphone audio. I mean when I play music with a media player I want record it. I want record the sound output

Capturing runpy.run_module stdout

I'm unable to capture stdout of runpy.run_module into a variable using StringIO. To demonstrate the problem, I created a script called runpy_test.py (code below

EXIT CODE 1 when restore sql file in postgres

I have an SQL file which is manually generated. I use the code below to create it. conn = psycopg2.connect(host=t_host, port=t_port, dbname=t_dbname, user=t_nam

just installed Python, getting WinError 32 for any libraries I try to install

I just installed Python 3.10 on my work machine. I went to pip install pandas and got a Win32 error on a temp file within the AppData Temp Folder.I have tried

Python: 'ModuleNotFoundError' when trying to import file from same directory

Running Python 3.10. I have three files in the same directory named Chess, one of which is a __init __.py to make sure it's considered a module. In one file, Ch

Trouble running InstaPy quickstart

I was able to install InstaPy on an Oracle Ampere Compute VM (ARM processors) running Ubuntu 20.04 LTS. When I try running quickstart.py, it showed me the follo

FastApi returns "field required" and "value_error.missing" for one of my parameters, but the field is there

I do a Post with some parameters, but one of them returns "field required" and "value_error.missing", but the field is there and it has a value. See the output

Import Error: can't import name gcd from fractions

I'm trying to import a function called gcd from a module called fractions with from fractions import gcd. For some reason, PyCharm throws an ImportError: fr

Can any one explain the logic behind this code [closed]

Sorry for asking this very basic question - but I cannot understand why it does what it does. a = int(input('Enter No. of rows')) for i in ran

How can I set up a VirtualBox interface using a Python library in 2022?

I have a local installation of VirtualBox running on my host machine, which is running Windows 10. I am able to start and run a virtual machine of Ubuntu via th

[mac Monterey][Python 3.10.4][tkinter 8.6] Calling tkinter askOpenfilename crashes when repeatedly creating a window

I have a python program that allows users to repeatedly press a key that will create a tkinter window where they can open an image an manipulate it. The problem

OpenCV get pixels on an ellipse

I'm trying to get the pixels of an ellipse from an image. For example, I draw an ellipse on a random image (sample geeksforgeeks code): import cv2 path = r'C:\U

Unzipping the zipfiles within a url zipfile python

I can unzip a url zip file of csvs using the below code: import requests from zipfile import ZipFile from io import BytesIO import pandas as pd z = 'www.someur

raise exc.NoSuchModuleError( sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgresql

I created a sample flask application, I want to connect PostgreSQL database to my project. I installed flask_sqlalchemy. here is my Code from flask import Flask

why does my program execute an extra line("none") when executed?

I recently wrote a program using oop for an online coffee machine: from menu import Menu from coffee_maker import CoffeeMaker from money_machine import MoneyMa

Operate on .dat file, pickle mod

I have project to do in my studies and it is my first project in Python. I must create simply program for bank. With GUI I'm creating an account on classes and

Django app runs locally but I get CSRF verification failed on Heroku

My app runs fine at heroku local but after deployed to Heroku, every time I try to login/register/login as admin, it returns this error shown below. I have trie

Error when doing a PUTITEM type: <class 'str'>, valid types: <class 'dict'>

When doing a putitem to dynamo it is giving me the following error, the json I am reading from s3. this is the code dictItems = json.load(object_summary.get(

Python 3.8.0 Setup Failed - 0x80070666 Another version of this product is already installed / No Python installation detected

I installed 3.8.7, the dependencies didn't match up with the project I was trying so I uninstalled 3.8.7 and wanted to try 3.8.0. I get this error every time. T