Questions tagged [python-3.9]
A version of the Python programming language, first released on October 5, 2020. This tag is for issues that are specific to Python 3.9. For general questions use the more generic [python] and [python-3.x] tags.
python-3.9
1,135
questions
0
votes
1
answer
16
views
Stop a Program from Running using a Character Without pressing Enter key in Python 3.x
I have tried some solutions that I could get from the other threads here but still no luck. My issue is that the program can recognize the character I've entered but does not execute to stop the ...
0
votes
0
answers
20
views
Cannot install Ansible Automation Platform offline bundle on RHEL8 servers due to "missing" Python 3.9
I am trying to install Ansible Automation Platform setup bundle (ansible-automation-platform-setup-bundle-2.4-7-x86_64.tar.gz), downloaded directly from Red Hat's Ansible portal.
When I try to install ...
-2
votes
0
answers
27
views
"Import \"tensorflow.keras\" could not be resolved [duplicate]
I'm using python 3.9.0 and "Import "tensorflow.keras" could not be resolved error warning is occurring.
when runned 'pip list' it shows
keras 3.4.1 and tensorflow 2.16.2
whats the ...
0
votes
1
answer
32
views
pip install pytrec_eval fails with ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
I am trying to install pytrec_eval package using this command python -m pip install pytrec_eval but it fails with the following error: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] ...
2
votes
1
answer
47
views
Typing with TypeVar converts a type to an object
I am trying to implement a generator that will return a pair of a sequence element and a boolean value indicating whether the element is the last one.
from collections.abc import Generator, Iterable
...
0
votes
0
answers
61
views
ModuleNotFoundError: No module named '_ssl' running Python3.9
I'm trying to configure a virtual environment with Python3.9 (with other distributions works without problem) in Ubuntu 20.04 LTS but I got the error:
ModuleNotFoundError: No module named '_ssl'
I ...
0
votes
1
answer
34
views
How do I create a custom button class in tkinter?
I want to create a custom class for the tkinter button class. However when I run my code the button doesn't appear on my window. The programme doesn't throw any errors either. Running on Mac on python ...
0
votes
0
answers
11
views
Has anyone encountered a Segmentation fault when executing the effect method of econml on CentOS 6.3 using Python 3.9?
gdb bt information:
in dict_traverse ()
in deduce_unreachable ()
in collect ()
in collect_with_callback ()
in PyGC_Collect ()
in Py_FinalizeEx ()
in Py_RunMain ()
in Py_BytesMain ()
in ...
0
votes
0
answers
38
views
Create a .zip file which has python scripts and required packages and works inside a python virtual environment inside an air-gapped system
I want to create a python project .zip file to deploy inside a air-gapped system (No internet connection to download dependency packages/modules). Python version inside air-gapped system is python 3.9
...
0
votes
0
answers
57
views
Error when installing tensorflow_federated package in VS code in Windows 10
I want to install tensorflow_federated package in VS Code in Windows 10 by using 'pip install tensorflow_federated' command. My python version is 3.9.0. But I get this error:
WARNING: Ignoring invalid ...
0
votes
1
answer
79
views
TypeError: 'class Meta' got invalid attribute(s): manager_inheritance_from_future in Django4.2
I got above error while running the makemiragtions command. So I delete/renamed the existing migration folder and rerun the makemirations command it's is migrated but when I run the migrate I got same ...
1
vote
0
answers
159
views
ssl verification throws error with python 3.12 whereas in python 3.9 it succeeded
With python 3.12 I got the error:
SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1000)')
But with python 3.9 its working ...
0
votes
0
answers
16
views
CodeChecker store command error : Thrift invalid data error. How is it caused?
I have a codechecker web (UI) container running at codechecker.XX.de.
I have configured user using the server-config.json [for eg: user XX:XX, username XX, password XX]
I created a product for the UI: ...
0
votes
0
answers
59
views
Pytest coverage is not working with Python3.9, error out, no module named '_sqlite3'
I am trying to run pytest with coverage option (i.e. --cov) with python 3.9, it is not working, but when I run on Python 3.6 or 3.7 version it works.
python -m pytest --cov=my_package --cov-report=xml
...
1
vote
0
answers
51
views
PySpark socket timeout error when using .collect() or .count()
I have been working with PySpark and distributed computing to do work with dataframes that involve querying PI I have been working with the User Defined functions and have managed to get a semi ...
0
votes
0
answers
103
views
Unable to import tensorflow on macos python3.9
Recently received a new laptop (MacBook Air, M3, 2024) and after installing python (through the python website https://www.python.org/downloads/macos/) and tensorflow (via pip install tensorflow) I am ...
0
votes
1
answer
69
views
Trying to understand behavior of `_field_defaults` of `namedtuple` in Python 3.9 [closed]
I am new to Python's namedtuple, particularly, _field_defaults.
According to Python 3.12.3 official doc,
some namedtuple._field_defaults
Dictionary mapping field names to default values.
Would ...
1
vote
2
answers
40
views
Why is my Python code executing the lines after the if-else statement before the lines within the if-else statement?
I am a beginner at programming on Python.
I made a program with Chatgpt that I don't fully understand, but I know that I want to make many more if-else statements without making it complicated with ...
0
votes
1
answer
255
views
Can't install python3-tflite-runtime
I am currently on a Raspberry Pi 5 with the 64-bit RPI OS and I've been trying to install python3-tflite-runtime by following this website : https://wiki.seeedstudio.com/reTerminal-DM-Yolo5/
However I ...
0
votes
0
answers
55
views
ImportError: tools/python/lib/python3.9/lib-dynload/math.so: undefined symbol: PyFloat_Type
I am using Python 3.9 on Linux. The python installation structure looks like:
/tools/python/bin - containing python executable
/tools/python/lib/libpython3.9.so
/tools/python/lib/python3.9/lib-...
0
votes
0
answers
18
views
pyqt5 get signal in basehttprequesthandler [duplicate]
I am using pyqt5 in a python3.9 environment and there is one simple but difficult problem for me.
The main purpose is to run an http server using threads in pyqt5 and send a specific API request to ...
2
votes
0
answers
45
views
Why is only the port version not printed in the output?
I was trying to automate the NMAP Port Scanning using Python. When I executed the script, all went good, excepting the version of the port.
Here's the code:
import nmap
nm = nmap.PortScanner()
...
0
votes
0
answers
32
views
Tkinter bind double click not working as expected with multiple instances of the same object
I'm trying to write a utility that will allow me to query a database, display the returned data and then allow the user to double click on one item to load/expand it. I've come up with the class below;...
0
votes
1
answer
30
views
How to avoid the uncallable list error in callback_query_handlers?
I am making a telegram bot using telebot. This bot has to send a message with buttons. To process the callback data I use callback_query_handlers, but Python shows such a mistake when I start the code:...
0
votes
0
answers
30
views
MPTT Multiple Inheritance Fails after Upgrade From Django3.0 to Django3.1
I've been having little luck trying to solve this issue so far. But in order to fix some vulnerable packages I'm upgrading a Django application from 2.8 -> 3.2, going from 2.8 -> 3.0 worked ...
0
votes
0
answers
41
views
Error in reading .gz file in python using gzip
I am using code to read file from AWS s3 bucket using boto3, throwing error "Not a gzipped file (b'\xef\xbb')"
even if filename is ends with .gz and the content type is also application/x-...
1
vote
0
answers
93
views
Wireshark is crashing after printing the result
Wireshark is crashing after printing the result. The root cause is we are dumping packets into a specific file and trying to post process continuously since packets are being cut into half error is ...
0
votes
0
answers
118
views
pip install pyqtchart hangs before giving _in_process.py: '/usr/bin/qmake -recursive PyQtChart.pro' failed returning 3
I have been trying to install PyQtChart in a Python 3.9 pipenv to use in conjunction with PyQt5==5.15.6 (as this is the latest PyQtChart version), but whenever I run pip install pyqtchart or pip ...
0
votes
2
answers
79
views
How do I reload a python module?
This has been asked 1000 times before, but nothing seems to work for me.
Using Python3.9 and VScode, though I have tested it making edits with just the plain TextEdit app on mac as well.
I cloned this ...
0
votes
1
answer
37
views
ModuleNotFound error when using PIP in pycharm venv
I keep on getting an error when trying to use pip in my virtual environment in pycharm. Every time I try and install a package using pip it comes back with a ModuleNotFoundError.
enter image ...
0
votes
0
answers
29
views
Distributing Scapy in a Python Virtual Environment
I need to distribute a package among a group of servers that are, by design, all running the same OS and version of Python. I have a CI script in Gitlab that is pretty straight forward. I'm using a ...
-1
votes
1
answer
404
views
trying to use this python code i found online to translate images with Google Translate in bulk but keep getting the "No module named 'google' error"
i'm trying to use this code i found online to translate images with Google Translate in bulk
# Args:
# input_dir: The directory containing the images to be translated.
# output_dir: The ...
0
votes
0
answers
215
views
ImportError when building Docker image: cannot import name 'appengine' from 'urllib3.contrib'
I'm encountering an issue while building a Docker image within my environment managed by Poetry. The error message I receive is:
ImportError
cannot import name 'appengine' from 'urllib3.contrib' (/...
0
votes
1
answer
251
views
How to track group ID change to supergroup in aiogram 2.x
My telegram bot works in chat groups and saves known user data and assigns a group ID to it. When the group type changes, the ID of the group also changes, so the code cannot find the corresponding ...
1
vote
2
answers
52
views
Get data from multiple tags from XML file
Having an XML like this:
<?xml version="1.0">
<!DOCTYPE us-application SYSTEM "us" []>
<us-application lang="ENG" dtd-version="v4">
<us-...
0
votes
1
answer
333
views
Python anaconda Jupyter error: cannot import name 'TypeVarTuple' from 'typing_extensions
I am using python 3.9 with anaconda, in a custom environment. The fact that I am using an older version of python is to have tensorflow-2.5.3 and tensorflow-gpu-2.10.0 and tensorflow-io-0.18.0 be ...
1
vote
0
answers
32
views
Why are these libraries incompatible with my virtual environment in Python 3.9 [duplicate]
I'm trying to run Python with a virtual environment and the code is written in 2020 so I'm using Python 3.9 in the virtual environment. I was able to get that running properly and here is the ...
0
votes
0
answers
28
views
Too many open files when using multiprocessing
I have written this code (discover/nodes.py) which get me list of nodes that have specific port (let's say 8134) open.
import os
import multiprocessing
import socket
# Local imports
from . import ...
0
votes
0
answers
33
views
How do I extract the specific elements of an XML based on attributes within that element in Python 3.9?
I have an example XML file that looks like this:
<House>
<ParamDefinitionList name="Pets">
<ParamList name="Pet">
<Param name="Animal" ...
0
votes
2
answers
93
views
VSCode output referencing different Python version to interpreter version
I'm trying to run code on Python 3.9.18, which I have chosen as my selected interpreter from my virtual environment. I guess I have so many different versions of Python installed because when I run ...
1
vote
1
answer
620
views
Problem when converting Python with Ultralytics to EXE file
I have developed Python program using YOLOV8 algorithm to detect human entry and it works perfectly in pycharm. when i convert it to exe file using pyinstaller im getting following error. Can anyone ...
1
vote
2
answers
154
views
Overriding DRF settings for tests
I'm using Python 3.9, Django 3.2, DRF 3.12.4. I'm adding JWT authentication method using simple JWT. To test my auth method, I need to set
"DEFAULT_AUTHENTICATION_CLASSES": (
"...
2
votes
1
answer
64
views
how to show progression of changing subplot labels (plt.text) along with color changing in an ArtistAnimation
running python 3.9:
import matplotlib.pyplot as plot
import numpy as np
import matplotlib.animation as animation
fig, plt = plot.subplots()
myArray = np.array([[0, 1, 2, 3, 4, 5, 6],
...
0
votes
1
answer
400
views
OpenAI Whisper: occasionally doesn't start transcribing until restarting the computer
I am using whisper to transcribe audio recordings. Sometimes, everything works well and the transcription proceeds relatively quickly but at other times, the same audio file won't start transcribing ...
1
vote
0
answers
44
views
Odoo 16 modifies the Add Details action
Adding detail lines in Odoo 16 does not auto-save, is there any way to trigger auto-save when adding a detail line?
I tried modifying the write method and it didn't seem to work.
Is it possible to ...
0
votes
0
answers
32
views
AttributeError: module 'urllib' has no attribute 'pathname2url'
I am using python 3.9.16 with robot 3.1.2 and urllib3.
Below packages and version is used, and I got Error: module 'urllib' has no attribute 'pathname2url'
I am stuck , can any one help to solve this ...
0
votes
0
answers
43
views
pythonic way to get type hint checking of dynamically imported methods
Python newb who's struggling to get out of his statically typed OOD habits.
I have a CLI that will support the ability to pipe to methods to transform output. So I can run something like this:
...
0
votes
2
answers
265
views
Error when trying to install a module through the pip package manager
I can't seem to install any package, I`ve been trying to install pygame especifically.
Although this problem only happens inside the virtual environment I made in VSCode, as in PyCharm It works ...
0
votes
0
answers
24
views
Pip3 not updating dependencies when installed in a specific path
I am using pip to install firebase-admin, requests==2.28.0, urllib3==1.26.7.
I start installing firebase-admin which comes with requests==2.31.0 and urllib3==2.1.0
What i am trying to achieve is to ...
0
votes
1
answer
312
views
Run Tests with Coverage "TypeError: Parameters to Generic[...] must all be type variables"
When running tests with coverage using PyCharm on django (python) project, im having the following error:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2023.1.2\...