43 questions from the last 30 days
Best practices
0
votes
6
replies
103
views
How to handle undefined when converting JS obj into Python dict for later JSON use?
I am trying to convert a JavaScript object into a Python dict for processing and later export to JSON. So far easy peasy by using demjson3.
BUT: since there are undefined values it will convert these ...
3
votes
2
answers
87
views
Python asyncio.gather returning Future attached to differnt loop exception
I am using Python 3.13.2.
I am going through the Python asyncio tutorial here. At around 10:20 timestamp, the instructor shows an example of asyncio.gather with a coroutine accepting a Future.
Here is ...
0
votes
1
answer
134
views
How to modify a Python function to handle one, several, or all parameters in a dictionary
I want to setup an environment in a Jupyter notebook where parameters are stored in a dictionary parValue and where you can change values of one or several parameters with a function par(), while ...
0
votes
2
answers
128
views
PyCharm keeps using a non-existent Python 3.14 interpreter even after removing it from the system
I’m on Windows 11 and originally had two Python installations: 3.14 and 3.9.
Both were installed and added to the PATH.
After setting up PyCharm 2025.2.4, I started getting this error when creating a ...
1
vote
1
answer
132
views
Uvicorn /FastAPI strange behavior
I create simple app using (python 3.11, uvicorn 0.38.0, fastapi 0.120.2):
import os
import time
import asyncio
import uvicorn
from fastapi import FastAPI
from fastapi import BackgroundTasks
app = ...
1
vote
1
answer
89
views
"RuntimeError: PdhAddEnglishCounterW failed" in python psutil module
I try to get free memory and swap amounts on Windows 7 64bit machine with psutil python module. Virtual memory info works normally, but getting swap information failed:
Python 3.8.6 (tags/v3.8.6:...
-3
votes
1
answer
123
views
Curl completing too late for following instruction
I updated my Fedora OS for the first time in many years, and the python version updated as well. This necessitated some minor changes to my existing code (naked print no longer allowed, <> ...
3
votes
1
answer
62
views
Unable to import_model .h5 in an attemp to try classification because of "BatchNormalization could not be deserialized properly"
I've got a very small python script using a Model.h5 which should be loaded in order to classify some pictures.
Here's my python script :
import tensorflow as tf
from os import walk
from keras.models ...
0
votes
1
answer
100
views
Python Module or Library with multiple Thermal printer support
I am currently printing thermal receipts with small python code prints thermal receipts for my billing application.
What I am currently doing is
Build the receipt to PDF using Reportlab
then convert ...
1
vote
1
answer
94
views
ERROR: No matching distribution found for setuptools==80.9.0 (windows 11)
When I tried to upgrade "setuptools" in my virtual environment, pip (already upgraded) recognizes a list of versions between 0.6b1 and 75.3.2. I did upgrade it to the latest version.
However ...
1
vote
1
answer
111
views
Installing OMPL on Anaconda in Windows
I cloned the OMPL repo into my system and tied to install it. So, I used these commands:
First I cloned it from the repository using
https://github.com/ompl/ompl.git
Next I created a new folder inside ...
-8
votes
2
answers
95
views
How do I use pipenv? [closed]
I keep getting stuck in the terminal trying to execute the commands to install Django. This is what I keep on seeing.
$ pip install pipenv
Defaulting to user installation because normal site-packages ...
-4
votes
1
answer
54
views
Exception 'FileNotFoundError: [WinError 2] The system cannot find the file specified' encountered while installing pygame [duplicate]
A few weeks back, I got a fresh new copy of Python 3.14 on my Windows 11 PC. So, as many of my projects use pygame and pgzero, I had to install it. But this bunch of error messages are appearing:
...
1
vote
1
answer
55
views
Python AppleScript module fails: AttributeError: 'str' object has no attribute '_unpackresult'
I have been using the AppleScript module in Python for some time now, but its latest version is refusing to work on any but the most trivial code. This is the Python script:
#!/opt/local/bin/python3
...
-2
votes
0
answers
70
views
Как подключить python скрипт к базе данных mysql на phpmyadmin? [closed]
Пароль я использую настоящий, тут я его просто скрыл. Объясните мне пожалуйста, что я сделал не так? Вот сам скрипт:
import pymysql
try:
# Подключение к базе данных
connection = pymysql....
Best practices
0
votes
1
replies
62
views
Inquiry: Best Practices for Automating Superset Dashboard Deployments via CI/CD
How to automate deployment of Superset dashboards, charts, and datasets to the target environment (UAT/Prod) from Bitbucket using a CI/CD pipeline running on Cloud Build, Bitbucket Pipelines, or ...
0
votes
1
answer
72
views
Web Automation w/ Selenium
I'm trying to automate sending a tweet via Selenium (Python) and while I'm able to access the page using my existing chrome profile, I'm not able to access any elements and what's more is that it ...
Advice
0
votes
1
replies
57
views
How can I truncate the 15 lkh data set which is unfiltered to filter then upload on MySQL
I want that the data will arrange in a proper manner firstly the data have clear and remove duplicate and missing values then I write a my code in pandas to upload and process the same thing again ...
1
vote
1
answer
68
views
Spark JDBC reading wrong character encoding from PostgreSQL with server_encoding = SQL_ASCII
I'm reading data from a PostgreSQL 8.4 database into PySpark using the JDBC connector.
The database's server_encoding is SQL_ASCII.
When I query the table directly in pgAdmin, names like SÉRGIO or ...
2
votes
1
answer
49
views
Calling `sys.excepthook` manually with `sys.last_exc`
The signature of sys.excepthook is
sys.excepthook(type, value, traceback)
so a natural way to call it is
sys.excepthook(sys.exc_type, sys.exc_value, sys.exc_traceback)
But as of Python 3.12, ...
-1
votes
0
answers
72
views
Threading Error when attempting to render 3d plot in a browser using PYVISTA, I think
I was given the task of creating a web app out of a preexisting Python library that another BU developed, and they are using it solely in a Linux environment via the command line. The ask was to put a ...
1
vote
1
answer
55
views
how to make socket server propagate exceptions up to TaskGroup where they're started from?
How to make exceptions thrown from a socket server running in a task group task be propagated up to its parent TaskGroup? With given example, I'd expect to see the error raised from ...
2
votes
0
answers
49
views
Managed Identity does not allow a call to MS Graph API
I created a user-assigned Managed Identity and granted it Sites.Read.All permission to MS Graph API. Then, I created a notebook instance on Azure Machine Learning and assigned it the created managed ...
0
votes
1
answer
60
views
Tkinter grid propagation and scrolling
I have a tkinter window that runs script, with this general layout:
┌─────────────────────────────────────┐
│ Op Buttons │ ← Row 0 (fixed)
├───────────────────────────────────...
2
votes
0
answers
97
views
Python-docx add_page_break is not visible in the document
I'm trying to write a document using python-docx library. I'm adding some simple text with and then I add page_break after each paragraph. Later on, I save and open the same file again. The ...
-4
votes
0
answers
46
views
Do Python variable references get stored on the stack or the heap? [duplicate]
Where does the reference to a variabl e.g. x = 3 get stored in Python?
Sources on the web say that the references are stored on the stack. ex:
Stack Memory: Stack memory stores temporary data, ...
0
votes
0
answers
74
views
RuntimeError: MolToImage requires that the RDKit be built with Cairo support; Happens in Anaconda3 Python3
I am trying to draw molecular structures with rdkit.
Windows 11. Tried both Jupyter NB amd Spyder under Anaconda 3.
Many other functions in rdkit work, but Draw crashes with this message:
RuntimeError:...
2
votes
0
answers
47
views
PywinAuto API - child_window - returning multiple elements
Here is my code which is throwing me an error
I am trying to open a Group Policy Editor and select setting under Personalization.
I have obtained the sample code from this question
GUI Automation of ...
-1
votes
0
answers
37
views
Will AI becomes a threat for future engineers to get a job? [closed]
1.use of programmers to write code even ai is present?
2.will future engineers will be effected for getting jobs due to AI?
3.Can AI provide an exact code without an single error what the client is ...
0
votes
0
answers
42
views
DB2 CLP command via subprocess.run sometimes returns empty output and sometimes SQL1024N: A database connection does not exist
I'm running a DB2 stored procedure from Python using subprocess.run.
The command works perfectly when I run it directly in my shell:
db2 'CALL GET_DBSIZE_INFO(?, ?, ?, 0);' | awk -F': *' '/Parameter ...
1
vote
0
answers
44
views
Extra "pyside" and "qt" in SRC_URI
I'm getting some strange behavior in my Yocto build of PySide6. I've cloned the meta-qt6 layer (release 6.8) and I want to install PySide6. I found that I was getting a bunch of do_fetch errors ...
0
votes
1
answer
47
views
pyenv: No global/local python version has been set yet. (windows 11)
I am not allowed to install anaconda on my enterprise machine, so I decided to use pyenv to manage virtual environments. I am following this tutorial to get my hands on pyenv.
I think that my issue is ...
Advice
0
votes
2
replies
30
views
What are all possible Python asyncio.open_connection() Exceptions?
I am writing a python program that is supposed to receive commands remotely, open a TCP connection locally (but not limited to localhost), and report the result.
I was looking for list of possible ...
0
votes
0
answers
34
views
I am using JupyterLite to run some python code. And there is a specific cell which is not executing as desired
When I run the cell below, and there is no file with the same name as filename, it executes perfectly. But on subsequent runs, if there exists a file with the same name, the kernel gets busy and ...
-2
votes
0
answers
40
views
Azure Function App (Python 3.11 on Linux) stopped detecting all functions after Flex Consumption update – even Basic plan does not work [closed]
I’m running into a blocking issue with a Python 3.11 Azure Function App on Linux.
Until this week my Function App contained three HTTP-triggered Python functions and everything worked perfectly. After ...
0
votes
0
answers
29
views
Error in V1Binding when using a custom scheduler
I encountered the error
V1_binding.py", line 156, in target
raise ValueError("Invalid value for `target`, must not be `None`")
ValueError: Invalid value for `target`, must not be `...
0
votes
1
answer
20
views
nicegui.testing with User fixture for upload file ui.upload
Hello i am new on nicegui, i create a simple app where i need to upload the files and store this files on ftp server. I start to make some tests with nicegui.testing.User (i use this package because i ...
0
votes
0
answers
24
views
How do I prevent two VWAgent workers from deadlocking when they face each other after task assignment?
I’m working on a multi-agent grid environment using the VWAgent framework.
I have three agents:
White: explores and broadcasts cleaning assignments
Green & Orange: wait until assignments, then ...
1
vote
0
answers
27
views
Python GVM API Broken Pipe
I'm writing an API to scrape openvas reports and extract metrics to expose them on an endpoint for prometheus to scrape them. There's a broken pipe when executing the following code:
#!/usr/bin/env ...
0
votes
0
answers
29
views
How to run MLLib random forest in Databricks on time series data?
I try to forecast time series data, namely the "outgoing_quantity". My data consists of two "ID" columns ("gtin" and "location_id"). For each combination of ...
0
votes
0
answers
52
views
Pydantic v2 ignores variable in .env for nested model
While working on my project I encountered a problem that can be reproduced by the following minimal example.
# main.py
from .settings import app_settings
if __name__ == "__main__":
...
1
vote
0
answers
57
views
How to delete a persistent chromadb collection
I want to delete a persistent chromadb collection after 12 hours, I am currently saving the time the collection was created in mongodb and then check it against current time, if it it is 12 hours old ...
Best practices
0
votes
0
replies
106
views
Implementing TTL-based in-memory cache for macOS activity tracking
I'm building a local-first macOS productivity tracker that reads from the system's KnowledgeC database to analyze focus time and context switches. Since querying this SQLite database can be expensive ...