Questions tagged [python-3.10]
A version of the Python programming language, first released on October 4, 2021. This tag is for issues that are specific to Python 3.10. For general questions use the more generic [python] tags.
667
questions
-4
votes
0
answers
30
views
Differences in DNA strings [closed]
I must write a function in python, that given any list of DNA strings, creates the corresponding differences matrix. For better understanding, I have put an example of two matrices that compares two ...
0
votes
0
answers
28
views
opencv python M1 Macbook Issue
Hello I am new to stack overflow if I paste something wrong I am sorry. I have made a little program in order to scan QR code and print it in the terminal.
The code is working but when I start running ...
2
votes
1
answer
57
views
Why are TypedDict types without field and with NotRequired field incompatible?
I am trying to create a few functions which will return values of different TypedDict types. Most of fields in them will be same so I want to generate base dictionary with same function in all cases. ...
0
votes
0
answers
16
views
I am unable to create a pex file with a custom pacakge inside
I was following this tutorial to add my own pacakge to .pex but this tutorial is based on python2 and I try to recreate for python3.10.6 but does not works.
The structure of my package is as follow ...
0
votes
0
answers
15
views
How to switch json_logging to normal human-readble mode
I use json_logging in a FastAPI app under uvicorn. But for development purpose I need human readable logs. How can I turn json_logging produce normal logs?
I initialize logging this way:
json_logging....
0
votes
1
answer
28
views
Error loading shared library libpython3.10.so.1.0
I get the following error
Error loading shared library libpython3.10.so.1.0: No such file or
directory (needed by /usr/bin/aws) Error relocating /usr/bin/aws:
Py_BytesMain: symbol not found
when I'm ...
0
votes
1
answer
43
views
match case in micropython - SyntaxError: invalid syntax
I am using python 3.10.5 on my raspberry pi pico and I am trying to use match & case instead of if statements When I try to run the program it returns an error:
Traceback (most recent call last):
...
0
votes
1
answer
23
views
Is there a way to use this dropdown menu to assign a variable value - Jupyter notebook
from ipywidgets import widgets
options = ["1", "2","3"]
dropdown= widgets.Dropdown(options=options)
display(dropdown)
x = dropdown.value
Every time I run this the x ...
0
votes
1
answer
13
views
I want my telegram bot to send messages at the exact time but when I run my code the message sends immediately and no errors pop up
This is the part of the code where I tried to use scheduler
scheduler = BackgroundScheduler(timezone="Europe/Istanbul")
@bot.message_handler(content_types=\['text', \])
def get_name(message)...
0
votes
0
answers
14
views
Intermittent failures with unittest.mock at Python 3.10
I'm running a test suite at Python 3.10 for the first time and am getting intermittent test failures. The suite passes as Python 3.8 and the failing tests also pass if I debug them in VSCode. The ...
0
votes
2
answers
31
views
How to migrate `shelve` file from Python 3.10 to Python 3.11
Code:
with shelve.open("cache") as db:
...
Python 3.10.9 result
A cache.db file is created.
Python 3.11.1 result
Three files are created: cache.cir, cache.bak, cache.dat.
What I need
I ...
0
votes
0
answers
6
views
I am facing a Flask error (Attribute error: init)
I am new to flask and I am having some problems one of them being,
When I try to start running the below app on the server I get an error saying Attribute error: init
I have no clue what to do next ...
1
vote
1
answer
54
views
create dataclass with optional attribute [duplicate]
I'm trying create dataclass with optional attribute is_complete:
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class MyHistoricCandle:
open: float
high:...
-2
votes
0
answers
18
views
Python issue with indentation [duplicate]
I'm getting this error: IndentationError: unindent does not match any outer indentation level
Cloud Requests/profanityTest.py"
IndentationError: unindent does not match any outer indentation ...
-1
votes
0
answers
24
views
cv2.error: Unknown C++ exception from OpenCV code | tracker.init(frame, bbox)
I am stuck with this error in my code: cv2.error: Unknown C++ exception from OpenCV code. I am trying to run a code for moving vehicle detection and this error that is prolly related to c++ classes, ...
-2
votes
0
answers
17
views
How to rename files correctly?
Help! there is a list of songs, but there are unnecessary letters and symbols in the name of the songs. How do I remove unnecessary characters from the song title and save them in the same title, but ...
0
votes
0
answers
15
views
OpenSSL package issue in python 3.10
Am trying to run a following command which was perfectly running in Ubuntu 20 with python version 3.8.
comm = 'openssl pkcs12 -in %s -out %s -nodes -passin pass:%s -clcerts -nokeys' % (pkl_path,...
0
votes
0
answers
24
views
Can't capture using set-literal, set(), or empty dict-literal (PEP-634, PEP-636) [duplicate]
I work at a Python shop, and I've got the green-light to start using 3.10 (we're so cutting-edge). SMP was a little disappointing at first, as I was anticipating Rust-style matching, but it's still ...
0
votes
0
answers
46
views
Python, PySide6; JS not receiving data from QWebChannel
I've seen many many answers about this question, but still cannot figure it out.
I made two files, one - html with qrc definition + new QWebChannel, and second python file with Object and ...
0
votes
2
answers
21
views
Unable to import from file in higher/lower directory?
When I try to import my Function from a lower directory it doesn't work.
It works if both file's are in the same directory but if they are not, it fails saying there is no Module named "...
0
votes
1
answer
33
views
Python for loop over dictionary stops after first match with IF statement
Trying to write a simple script to determine the moon name for the date. I have a dictionary of dates and moon names and tried to iterate over each to compare today's date to the date of the full ...
0
votes
1
answer
63
views
python asyncio class to create functions dynamically and execute with own interval parallel
I am trying to write a class that create methods dynamically that should executed parallel each with it's own duration with asyncio. But I am really new in the topic python asyncio and now on a point ...
0
votes
2
answers
52
views
Downloading >=Python 3.10 for VS Code
I am a complete beginner at Python and am going through the CS50P tutorial. The tutorial just went through match commands, and as I tried to run a program including match on VS Code an error message ...
0
votes
0
answers
40
views
Why pyright doesn't allow str.join of a non-literal set?
The following code produces the error message:
Operator "|" not supported for types "set[str]" and "set[str]"
...... Operator "|" not supported for types &...
0
votes
1
answer
31
views
ModuleNotFoundError on own made model folder
Doing some testing on my own game that I am using to learn python. I am attempting some Code Coverage using the CoveragePY that I have installed via PyCharm's Package Manager. Wrote up my tests, right ...
1
vote
0
answers
38
views
Impossible to retrieve data form pyattck module
I am using the pyattck module to retrieve information from mitre att&ck.
Versions:
- pyattck==7.0.0
- pyattck-data==2.5.2
Then, I just created a simple main.py file to test the module....
0
votes
0
answers
65
views
Google Cloud Function with Github Actions - ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed with status:
I have the following github actions file in .github/workflows/deploy.yml:
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- id: "...
0
votes
0
answers
43
views
403 Forbidden (error code: 50007): Cannot send messages to this user
I have a bot on discord and when i start the host, i get this message repeatable "403 Forbidden (error code: 50007): Cannot send messages to this user". What should I do. I will let the main....
0
votes
1
answer
168
views
ruff : E999 SyntaxError on match/case syntax
I got a strange issue with ruff (0.0.209) and python 3.10.9 interpreter when I use match/case syntax.
For instance, this simple code :
from http import HTTPStatus
http_status = HTTPStatus.OK
match ...
0
votes
0
answers
20
views
Django Server stuck after updating from python 3.9 to python 3.10 (using Django 4.1.5)
After upgrading python 3.9 to 3.10 the Django Server isn't working locally anymore (I'm using the Django Server Plugin for Pycharm). In my gitlab pipeline it seems to work allright.
Below you can see ...
0
votes
2
answers
124
views
MariaDB Python OperationalError: This feature is not implemented or disabled
I've compiled and installed Python 3.10.9 (from .tar) and mariadb-c-connector (from official Github repo) on my Debian 11 (bullseye) machine.
I also installed: ufw, fail2ban, mariadb-server, mariadb-...
0
votes
0
answers
19
views
python script not executing function from JSON intents file using neural intents
I have a python script that uses neural intents.
The scripts work well when it is just recognizing a pattern and return one of a few possible replies.
But when I need to call a python function, it ...
0
votes
0
answers
24
views
How to combine two matplotlib figures as subfigures without replotting them
What i want
I want to combine two matplotlib figures in one new subplot.
The two figures are returned from visualization functions of libraries i don't want to or can't change myself(rebuild from ...
2
votes
1
answer
43
views
Python Structural Pattern Matching: str(True) doesn't match into str(True)
I've found an unexpected behaviour for Python structural pattern matching that I want to discuss today.
All the code there is run with CPython 3.10.8
So, let's take a look on the code below
match str(...
0
votes
1
answer
28
views
Does't work django-admin startproject mfdw_site
I installed Python,and then Django.I checked that Django is installed with --version command.I installed VENV.
Now I want to start a Project,but django-admin startproject my_site does't work.
I'm ...
0
votes
0
answers
34
views
How to make predictions with Mask R-CNN and python 3.10
My problem:
I have weights for a Mask R-CNN Model, which has been trained using python 3.7 and tensorflow 1.13.1. I can use this environment to make predictions.
I am able to reproduce those ...
3
votes
1
answer
75
views
Type annotations for full class hierarchy in Python
Suppose we have the following code:
class Base:
a: int
class Derived(Base):
b: int
print(Derived.__annotations__)
Running this script in all recent versions of python will print {'b': <...
0
votes
5
answers
171
views
write a program to store seven fruits in a list entered by the user
a = input("Name of 1st Fruit: ")
b = input("Name of 2nd Fruit: ")
c = input("Name of 3rd Fruit: ")
d = input("Name of 4th Fruit: ")
e = input("Name of ...
0
votes
1
answer
43
views
Handling nested schema in fast api while storing data
I have a nested schema in fast api below is the book model`
class Book(Base):
id = Column(Integer, primary_key=True, index=True)
title = Column(String(256), index=True)
subtitle = Column(...
1
vote
2
answers
23
views
While writing test for Python script, the function I am testing is interchanging the positional argument and test is failing
This is func_randomgame.py file. My main file
import random
def run_game(guess, answer):
if (0<guess<4):
if (guess == answer):
print('You Won!')
return True
...
0
votes
0
answers
38
views
SSLCertVerificationError in python pandas dataframe , M1 macos
I try to read CSV from URL of the pandas dataframe, but it shows an error "SSLCertVerificationError ", how to deal with it? My laptop is M1 macOS, I'm not sure why.
Here is my code:
import ...
2
votes
1
answer
25
views
Using the Menu.add_command() function in a for loop only uses the last iterable [duplicate]
This is kind of complicated to explain. So I am making a program that opens certain files in a directory. I want to achieve this by making the files options in a submenu within a Menu. The first half (...
0
votes
0
answers
28
views
Even after upgrading my python library to 3.10 the package is getting installed in 2.7 dir
I am trying to upgrade my python debian package from python2.7 to python3.10. I have upgraded the source code with help of py2to3 library and modified the debian/rules, debian/control with suitable ...
0
votes
0
answers
35
views
Setuptools doesn't find a package that is installed
I am trying to install a package "editable" for developing. I have already installed all dependencies into my virtualenv, but the installation of the package is failing:
$ . ./venv/bin/...
2
votes
0
answers
69
views
No Module Error in Pycharm ONLY When Using A Notebook
I am trying to import a method from a module outside the current module.
While I can do this from a script without any issue, when I try it from inside a Jupyter notebook, it fails. How do you suggest ...
0
votes
0
answers
24
views
Python socket error: (OSError: [WinError 10057]) [duplicate]
I'm making a python code that every 7 seconds send a screenshot through a socket, I have a server and a client. when I run the server I get an error:
the client takes a screenshot every 7 seconds ...
-1
votes
3
answers
58
views
How can I install packages?
I can't install a package with the pip or pip3 command and I can't install it from the Python Interpreter in PyCharm too. I can't tap on the '+' at the Python Interpreter in PyCharm.
I get this error:
...
0
votes
1
answer
29
views
Unable to call method from extended class
I have a Parent class that I extended into a child class, and the goal is to reuse an already created working functionality, but it seems an error occurred when using the parent class method
from sr ...
0
votes
3
answers
130
views
Upgrade python3.8 to 3.10 in Ubuntu Docker image
I am using playwright base image
FROM mcr.microsoft.com/playwright
Unfortunately, this comes with python3.8. I could either use python3.10 image and install playright on it, but it came with other ...