2,209,292 questions
1
vote
0
answers
33
views
TPU Initialization Fails (OpKernel Missing) Despite Active TPU Runtime in Kaggle
I am facing a persistent issue when trying to initialize the TPU in my notebook. I have already confirmed that:
My account is Verified.
The Notebook Accelerator is set to TPU.
My TPU quota is ...
0
votes
1
answer
27
views
Cannot update python in Conda by following Conda documentation
I'm running MacOS Sequoia: 15.6.1
I want to update miniconda python 3.9 to 3.12.
I first updated miniconda and packages via
conda update conda
conda update --all
The current version is conda 25.9.1.
...
-2
votes
0
answers
87
views
Computing the area by Python [closed]
I have a set of points that lie around a center approximately at . These points are not perfectly arranged on a circle, but they form an irregular circular shape around the center.
What is the best ...
1
vote
1
answer
78
views
What is the most Pythonic way to create a subclass of an object based on a string parameter
What is the best practice for creating an object based on the value of a string argument?
I am loading my configuration from a file and passing the string as an argument that gets mapped to a specific ...
Tooling
0
votes
0
replies
17
views
python pex to distribute a project
I have a python project and want to distribute it as a single file. I found PEX but found it difficult to use. Initially, I thought if my project is in a folder like the following
<folder>\
...
-1
votes
0
answers
38
views
Can I use `feedparser.parse` to parse a rsshub feed or some other way?
Can I use feedparser.parse to parse a rsshub feed(https://github.com/DIYgod/RSSHub) or some other way?Such as I want to get rss
content of "https://rsshub.app/bilibili/ranking/0/3/1".
And I ...
1
vote
0
answers
27
views
PyInstaller build fails on Ubuntu 22.04: portError: libscipy_openblas-b75cc656.so (works on Ubuntu 24.04)
I’m building a Python 3.12.10 application with PyInstaller on Ubuntu 22.04. The same project and PyInstaller spec work when I build on Ubuntu 24.04, but on 22.04 the executable fails at runtime with ...
0
votes
0
answers
36
views
Confusion on including meta.yaml in my source code
I am following the conda tutorial for using conda-build here which says to create a meta.yaml file so conda-build can create the conda package. This tutorial uses click as an example, and I know ...
1
vote
1
answer
53
views
In pyproject.toml, can I specify building a required dependency from source?
In my Python project, I use the library just_playback as a dependency. When I'm on my development machine, I just fetch the library from PyPI and it works like a charm. However, the client I'm ...
0
votes
0
answers
51
views
send bulk mail in flask through 4 deferent deferent mails domain server
import os
import re
import time
from datetime import datetime
from smtplib import SMTPRecipientsRefused
import pandas as pd
from celery import Celery
from celery.schedules import crontab
from flask ...
2
votes
2
answers
59
views
python vs. pyenv installation
Today I installed two different versions of python on my windows 11 machine:
python 3.14.0 installed using executable downloaded from python repository
python 3.10.10 installed using
pyenv install
...
0
votes
0
answers
62
views
Why does my Python script exit without showing any error or output? [closed]
I’ve written a Python script that should print some output or at least show an error if something fails. However, when I run it, it just exits immediately without showing anything.
There’s no ...
-3
votes
0
answers
70
views
How to automate the daily import of TXT files into SQL Server? [closed]
In the company where I work we receive daily TXT files exported from SAP via batch jobs. Until now I’ve been transforming and loading some files into SQL Server manually using Python scripts, but I’d ...
-1
votes
0
answers
45
views
List interquartile range for object attribute [closed]
I have seen many ways to do interquartile ranges, but I've not been able to figure out how to do it for a list of objects whereby I end up with a list of those same objects (in the correct range). The ...
-2
votes
1
answer
62
views
dataclass __repr__ shows init=False members
import dataclasses
@dataclasses.dataclass
class MyClass:
a: int
b: int = dataclasses.field(default=0, init=False)
m = MyClass(a=0)
print(repr(m))
# prints: "MyClass(a=0, b=0)"
# `...
0
votes
0
answers
85
views
Django channels tutorial issue
As I am following the Django channels tutorial (here is the link:
https://channels.readthedocs.io/en/latest/tutorial/part_2.html
), I won't post any code except the specific problem I am having.
In my ...
3
votes
2
answers
182
views
Efficiently get first indices of consecutive identical digits in big pandas DataFrames
I have a DataFrame with a column Digit of digits at base 10. For example
import numpy as np
import pandas as pd
df = pd.DataFrame({
"Digit": [
1, 3, 5, 7, 0, 0, 0,
4, 8, ...
0
votes
1
answer
74
views
How to count appearance of all items in a row on Pandas Dataframe [closed]
II'm currently learning the Pandas library in Python (without AI assistance), and in one of my tasks I needed to count how many times each item appeared in a row of a DataFrame. Here's an example of ...
1
vote
1
answer
50
views
Python Gmail API script not saving attachments — CSV shows filename but files are never downloaded
I’m building a Python script using the Gmail API to read model application emails, extract data, and download photo attachments. Everything works except the attachments. the script keeps saying: ...
-1
votes
0
answers
51
views
What is the best way to track what decisions have been made in a text adventure in Python [closed]
I want to track what has already been done so that options change in response to the player's action history. I am currently using a score system, but I do not know if that is the best way to do ...
1
vote
0
answers
35
views
altair binned legend label alignment for min and max values
I'm following this example from the documentation:
import altair as alt
from vega_datasets import data
source = data.movies()
alt.Chart(source).mark_bar().encode(
alt.X("IMDB_Rating:Q")...
-3
votes
2
answers
86
views
Python Django Rest Framework [closed]
What is the difference between decorator @api_view and @csrf_exempt in project level django rest framework? I need the difference and which is better to develop the project.
1
vote
1
answer
35
views
agent.invoke() with Gemini gives inconsistent output types
I am using the LangChain 1.0 new agent = create_agent() method to create an agent but I am getting inconsistent output response types.
Case 1: str as output
When the user query is simple such as "...
1
vote
2
answers
43
views
How to avoid Plotly (plotly.express.line) line chart creating zig-zag line?
I want to create line charts with plotly, my X axis is a year, y a value. Sometimes, the data is incomplete, i.e., some curves will have years missing or will start in different years than others.
It ...
0
votes
0
answers
20
views
AppDynamics not working on EKS after migrating from Rancher
I'm using a Python application that had AppDynamics working correctly on Rancher, but it stopped working when migrated to EKS.
This application is able to connect to AppDynamics and creates the agent, ...