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.

3.9 was released on October 5, 2020 (PEP 596).


Use this tag if your question is specifically related to Python 3.9. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

1128 questions
2
votes
1 answer

Getting hnswlib error Index' has no attribute 'file_handle_count'

I am trying to use chromadb which is giving me error: c:\Users\satya\AppData\Local\Programs\Python\Python39\lib\site-packages\chromadb\config.py in instance(self, type) hnswlib_count = hnswlib.Index.file_handle_count hnswlib_count = cast(int,…
Satya
  • 8,693
  • 5
  • 34
  • 55
2
votes
1 answer

In Kivy I can't call a function from widget class from any class

The problem is that any class doesn't execute a function in the widget class, it doesn't give any error when the key is pressed but the command doesn't work. py. import kivy from kivy.app import App from kivy.uix.widget import Widget from…
DARKTITAN
  • 35
  • 4
2
votes
0 answers

Can't recover memory from deleted objects in Python

I'm working on a project where I temporarily store objects in lists. But it seems that even when all references to these objects are deleted, the memory isn't freed, which leads to very high RAM usage in my process. I've tried to reproduce a simple…
RobinFrcd
  • 4,439
  • 4
  • 25
  • 49
2
votes
0 answers

QGIS-Pycharm-QT Reference not found

I know it is a never ending story and there a lot of articles around and I tried a lot of the tips without no success. Maybe I should also mention, that I had a lot of different versions of QGIS installed. The last one which was functioning in…
The Rabbit
  • 141
  • 5
2
votes
2 answers

How to do the optimization for a mean squares error in a Python code faster

(I'm new to stack overflow, but I will try to write my problem the best way I can) For my thesis, I need to do the optimization for a mean squares error problem as fast as possible. For this problem, I used to use the scipy.optimize.minimize method…
2
votes
3 answers

How to type only the first positional parameter of a Protocol method and let the others be untyped?

Problem How to only type the first positional parameter of a Protocol method and let the others be untyped? Example, having a protocol named MyProtocol that has a method named my_method that requires only the first positional parameter to be an int,…
2
votes
1 answer

Unable to install mysqlclient in Python3.9

I encountered the following error while trying to install mysqlclient using the command pip3 install mysqlclient System information: Python 3.9, GNU/Linux Ubuntu 20.04 running on WSL x86_64-linux-gnu-gcc -pthread -Wno-unused-result…
wishfulwiz
  • 23
  • 4
2
votes
1 answer

What's the alternative to subprocess.CREATE_NEW_CONSOLE in Linux?

I have a Python 3.9 script that starts another process in a new console. The 'other process' keeps running even after the original one has completed. This is what I have on Windows: # startup.py script # ================= import sys, subprocess if…
K.Mulier
  • 8,069
  • 15
  • 79
  • 141
2
votes
1 answer

FastAPI is returning AttributeError: 'dict' object has no attribute 'encode'

I am having a very simple FastAPI service, when I try to hit the /spell_checking endpoint, I get this error `AttributeError: 'dict' object has no attribute 'encode'. I am hitting the endpoint using postman, with Post request, and this is the url:…
sin0x1
  • 105
  • 1
  • 3
  • 13
2
votes
2 answers

How to install Python 3.10 on the base enviornment of Anaconda?

I have python 3.9 installed in the anaconda base environment and have trouble installing the latest 3.10 version. I have tried to use "conda install -c conda-forge python=3.10" but it does not help resolve my problem. Over half a day, I have…
Amalie Shi
  • 41
  • 1
  • 8
2
votes
1 answer

importing a function defined in a different directory

Disclaimer: I am studying Python. I am given a task of reusing functions. the function is simple: app/utils/calculators.py def calculate_session(session_type, session_code): return 3 # just to save space Now i need to use the function from…
Erick
  • 63
  • 4
2
votes
1 answer

Abstract method allowing for additional arguments

Is it possible to have an abstract class require some specific arguments for a method of a Python class, while still leaving the possibility for concrete classes to add more arguments? from abc import ABC, abstractmethod class FooBase(ABC): …
Jivan
  • 21,522
  • 15
  • 80
  • 131
2
votes
2 answers

Tkinter in Python 3.10?

I am trying to use Tkinter in a Python 3.10 project. I have created a virtual environment with Python 3.10 and have installed Tkinter. When I run import tkinter I get the following error. Traceback (most recent call last): File…
KOB
  • 4,084
  • 9
  • 44
  • 88
2
votes
1 answer

inspect.Parameter.annotation method returns a string for imported methods vs. a type when defined in scope

Consider the following python file test.py: def accepts_string(s: str): pass If I open a python shell, import this function and then grab the function's parameter s and its annotation I get a string literal. >>> import inspect >>> from test…
2
votes
0 answers

Install packages for Python 3.9 on Ubuntu 22.04

I'm using Ubuntu 22.04 LTS, after the update, the default python changed to Python 3.10. However, most of the libraries I'm currently using are only available on 3.9. when I try to install packages by pip install mypackage it is by default…
brownser
  • 545
  • 7
  • 25