343,157 questions
0
votes
0
answers
6
views
use subprocess. Popen module and use pyinstaller to package as an executable when multiple window interfaces appear
When you use pyqt5 to call a child process to execute a py script, it is executed normally in pycharm, but when it is packaged as exe, the main interface window is repeatedly opened
**The requirements ...
0
votes
0
answers
13
views
Discrete histogram-bar plot and Continuous probability density in One plot and zorder for gridlines
I have created a histogram and overlaid the probability density. The Y-axis represents the percentage. The X-axis ticks follow the probability density, and the histogram bars are placed in between the ...
-3
votes
0
answers
16
views
Why I am getting this error - AttributeError: 'NoneType' object has no attribute 'is_displayed' [closed]
I am creating a basic code using python, i am just a beginner I am getting this error AttributeError: 'NoneType' object has no attribute 'is_displayed' when i am trying to just check if the username ...
0
votes
0
answers
6
views
How to run globally installed coverage on a package inside a virtual enviroment?
I'd like to run a coverage check with the following configuration:
coverage is installed globally on the system (via pipx).
pytest in installed inside the virtual environment of the project.
(Inside ...
-2
votes
0
answers
20
views
How do I remove the word "assistant" from a stream?
I have been trying to remove the word "assistant" from the stream as it always starts with this word. No matter what logic I use and implement on back-end it doesn't work, I want to handle ...
-1
votes
0
answers
13
views
Discord.py Command Sync Failure: Description too long
I'm trying to sync my Discord bot's commands using the bot.tree.sync() method, but I'm getting a CommandSyncFailure error with the following message:
@bot.event
async def on_ready():
print(f'...
0
votes
0
answers
10
views
Trouble Sending multipart/form-data with Python Requests
I'm trying to post three strings to a API/form. The webservice is called Nginx Proxy Manager if you are familiar. It don't really have API docs but it uses openapi 3.1.0. I'm trying to post to this ...
0
votes
0
answers
6
views
Issue on memory ram with langchain RetrievalQA
Hi im doing a RAG system with multiple vector databases using chainlit, langchain and FAISS. Few days ago i saw that RAG was using a lot of memory ram like 10gb, so i want to fix it, but i don't know ...
0
votes
0
answers
9
views
How to resolve a conflict between Debian 12 and Automake regarding the directory where compiled and packaged Python modules are installed?
First, some context.
The issue is related to the migration of a package from Ubuntu 16.04 to Debian 12. In the meantime, it was successfully (almost out of the box) installed and tested on Debian 10 ...
0
votes
0
answers
8
views
Is there a Python function that can generate the confidence intervals of the predicted probabilities of an OrderedModel?
I have data that looks like this:
age
health
female
54
4
0
45
3
1
35
3
1
28
2
0
26
1
1
33
5
0
And I'm trying to get the confidence intervals of the individual predicted probabilities after ...
0
votes
2
answers
32
views
Recasting values in Pandas dataframe that meet specific requirements
I have a Pandas dataframe that has been created by importing from an Excel spreadsheet. When using the .dtypes method, the column appears to be of data type object. However, within the single column, ...
-2
votes
0
answers
42
views
why wont the and in this while statement work? [duplicate]
i know this is kinda small, but ive been stuck on this for quite a while and it wont work. im trying to run the following while statement:
while xpos != x and ypos != y :
as seen in the code above, ...
-5
votes
0
answers
18
views
Why numpy don't come with python inbuild module? [duplicate]
I am new to python, while learning it, as a basic I created one calculator program that uses numpy module but while I execute it then I got the below error
import numpy as np
ModuleNotFoundError: No ...
0
votes
0
answers
11
views
Buildozer thinks can not find a file even though there is one
I'm currently making an apk from my kivy file using buildozer on a wsl and one of the requirements is kivymd version 2.0.1.dev0. I couldn't download it from github, so I got a .zip file. I compiled ...
0
votes
1
answer
36
views
Python, a method that is always executed before other methods in an instance of the class
I want to make it so that before executing the method of the class instance, another mandatory method was carried out:
class Example:
def __init__(self, x, y):
self.x = x
self.y = ...
1
vote
1
answer
20
views
Databricks MLFlow and MetaFlow integration
I am using Metaflow to orchestrate the training pipeline of a machine learning model and the scope is to combine Metaflow with the Databricks MLflow for monitoring of ML. The Metaflow pipeline is ...
0
votes
0
answers
23
views
Avoid file sharing lock in MS Access during bulk insert
File sharing lock count exceeded // python import to access table.
If anyone can assist with this you’ll be a life saver. I have a script in python that is attempting to automate a manual process in ...
0
votes
1
answer
19
views
Docker python not able to recognize custom module
I have a project with the following structure:
project/
checks/
__init__.py
<some files here>
engine/
__init__.py
<some files here>
models/
__init__.py
<...
0
votes
0
answers
8
views
Error: 'No module named pyimod02_importers' after creating EXE with auto-py-to-exe
I created an EXE file using auto-py-to-exe, but running it throws this error:
Failed to execute script 'pyiboot01_bootstrap': No module named 'pyimod02_importers'
Module object for ...
0
votes
0
answers
9
views
Error in pip install pypiwin32 in Dockerfile
I am trying to add python modules in Docker. My Dockerfile looks like:
FROM python:3.9
ADD ./src ./src
# ADD main.py .
RUN pip install --upgrade pip
RUN pip install pyyaml
RUN pip install ...
0
votes
0
answers
31
views
Return something from onclick?
I have a function that creates a chart with pandas & matplotlib. In the function there is an onclick handler that creates a table and then shows it with plt.show() upon click.
When the entire ...
1
vote
0
answers
18
views
Theme is not applying to the menu buttons on start
The menu theme is not applying to the buttons on start. Once you play through the quiz once and go back to the menu, the menu's theme then applies to the buttons
def menu():
def start_game():
...
0
votes
1
answer
47
views
How does GIL inserts the interupted thread and waiting threads back into the Ready Queue in Python?
Context:
I am executing the a python program that creates 5 threads as follows:
import time
from threading import Thread
def do_work(thread_number):
print(f"Starting thread {thread_number}&...
0
votes
0
answers
30
views
Curve fitting with different errors in positive and negative y-direction [closed]
I need to fit some data which of course has some uncertainty. Now some of said data was computed using an upper limit. So we know that the actual value lies between zero and said limit.
In order to ...
0
votes
0
answers
17
views
Having Trouble Downloading Results from Real-ESRGAN on Google Colab
I'm completely new to all this and I keep getting the same error feedback when I'm running the final download step.
zip_filename = 'Real-ESRGAN_result.zip'
if os.path.exists(zip_filename):
os.remove(...
0
votes
0
answers
7
views
Inserting a table into a known table with docx
Good day all,
I'm working on a very specific automation which requires a table being added into an existing table.
So far I can replace key words in a dictionary. However, I also want to be able to ...
0
votes
1
answer
37
views
debugging a script using vscode / debugging in a remote server
For the first time, i installed vscode in my laptop to work on a remote server (tradtionaly i'm using spyder when i'm working locally). I'm facing difficulties to debbug python codes in the distant ...
0
votes
0
answers
23
views
"Connection reset by peer" error in WebSocket FastAPI app
I’m working on a WebSocket app with FastAPI and could use some help troubleshooting an issue. So the app allows clients to connect to the WebSocket server and send parameters and based on these ...
0
votes
0
answers
51
views
Reindexing only valid with uniquely valued index objects
There are a couple of articles about this issue already, but none of them solve my issue.
I have two sets of Python dataframes (df_A1, df_A2 and df_B1, df_B2) and I want to combine the A's together ...
0
votes
0
answers
28
views
Python import on sub-package results in "no module named..." error
Although there are a number of import related questions, I haven't found one that directly addresses my question.
I have installed some packages in the default Site Packages folder and it has a ...
0
votes
0
answers
32
views
Virtual environments for Python not working in VSCode
I use the VSCode debugger for all of my Python projects extensively. But for one of my projects, the debugger just doesn't work.
Whenever I try to debug something, it seemingly tries to activate the ...
0
votes
1
answer
57
views
How to drag and drop items across frames in tkinter?
I have a tkinter gui which displays some nodes in levels.
The levels are split into frames and on each frame the nodes are placed as per a level dictionary defined in the class Viewer.
I want to drag ...
-4
votes
1
answer
58
views
I have a set of words I would like to exclude, and I want to check if each new word entered is contained wholly within another. How would I do this?
So I am currently making a word game, and I want to have it so that the user cannot enter a word that is wholly contained within another word (e.g. 'set' in 'subset'), however my current code:
noWord =...
-1
votes
2
answers
56
views
Unable to use psycopg2 with Postgres in Django
As stated in my question, I am now configuring my djagno project to connect with postgres. The issue i am facing is that, when making migrations, it shows me the following error:
python manage.py ...
1
vote
0
answers
41
views
How to make the windows icon bigger than 16x16?
I am having a problem not being able to make the window icon bigger than 16x16. It is awfully too small.
import os
import sys
import win32gui
import win32con
from PySide6.QtCore import Qt
from PySide6....
-3
votes
0
answers
21
views
Why AI is not responding? [closed]
I was trying to make a basic AI like Gpt 2 while chatting and voice capability. Also, perform simple commands. So here I made one with Python.It
import pyttsx3
import speech_recognition as sr
import ...
0
votes
1
answer
45
views
ModuleNotFoundError When Running Python Script in Visual Studio Code althogh this is the root directory of the project
I'm having trouble importing a module in my Python project while using Visual Studio Code. I receive a ModuleNotFoundError, indicating that Python cannot find the defmet_data_piplines module.
Project ...
0
votes
0
answers
16
views
Optimizing Perlin Noise Matching for Binary Image Comparison: Slow Processing and Low SSIM Score
I’m working on a project where I need to generate Perlin noise and match it with a binary (black & white) image. I want to find the Perlin noise pattern that best matches the input image in terms ...
0
votes
0
answers
17
views
Difference between [0]*n with [0 for _ in range(n)] [duplicate]
I'm trying to solve leetcode problem, for the same function, when I initialize the array with self.preSum = [[0] * (n_col+1) for _ in range(n_row+1)], the result is correct and when I initializ the ...
0
votes
1
answer
23
views
Python subprocess usnig rsync is syncing extra data
I am using watchdog to monitor files and move them from a directory using rsync. I overwrite the on_modified method. Rsync is syncing more than it should. The destinationDir = /home/pi/Desktop/...
0
votes
0
answers
25
views
Interactive Brokers OAuth1 live_session_token
Given the general community consensus that IB's OAuth just doesn't work I'm not expecting an answer but it would be much appreciated
I've been following this
https://www.interactivebrokers.com/campus/...
0
votes
1
answer
17
views
Pytorch start training process stucked when blocking GPU 0
The GPU0 in my server has been occupied by others' processes, so I blocked GPU0 and use mp.spawn to train my model, but it failed to create train process.
This is reproducible example:
import torch
...
0
votes
0
answers
12
views
Pytorch Geometric: None being passed to Custom Data while collating
I'm just starting out with the torch_geometric library, and I'm working on making a custom dataset. However, I seem to be misunderstanding something about how the libraries data loader interacts with ...
0
votes
0
answers
36
views
How can I reuse the existing asyncpg connection pool?
asyncpg.pool should be created at the first request and then reused for the next groups of requests. After the first successful use of the pool, an error occurs during reuse.
Environment:
Windows 10 ...
0
votes
2
answers
62
views
Is it safe to create asyncio event loop in one thread and run it in another thread while having ability to cancel it from outside the thread (python3)
I want to know if it's safe to create an asyncio event loop in one thread and run the loop in another while having the ability to cancel it from outside the thread in which the event loop is running. ...
1
vote
1
answer
50
views
Why am I getting an empty string if I use positive start index and negative stop and step index values?
I am trying to run this code snippet:
test="test"
print(test[3:-1:-1])
For the slicing, the start index should start from 3 which is inclusive and stop index should be -1 exclusive which ...
-4
votes
1
answer
61
views
Can Python 3 copy files without overwriting?
In a 2016 blogpost, it is claimed:
def notActuallySafeCopy(srcfile, destfile):
if os.path.exists(destfile):
raise IOError('destination already exists')
shutil.copy(srcfile, ...
-1
votes
1
answer
33
views
How to create and run a virtual environment for my Python programs in VS Code ? I want a few selected programms to run in a separate environment [duplicate]
I am using VS Code text editor for my Python programming. I need to know how to create virtual environments in VS Code for a project specific file.
I haven't tried anything since I am unaware of the ...
0
votes
1
answer
16
views
How do I send data to a specific field on a web page?
I am working with this web page created using cherrypy by someone else. I want to display data values generated in the server.py script in the four lat/lon input boxes below the map. The 'left' input ...
0
votes
1
answer
60
views
Why does curve fit sometimes work and not work in an interactive Python simulation?
I'm relatively new to Python GUI and have been working on a simple project relating to my physics classes.
I've been trying to simulate the Rutherford Scattering experimental data using Monte Carlo ...