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
7
votes
1 answer

How to use MaxLen of typing.Annotation of python 3.9?

I'm aware there's this new typing format Annotated where you can specify some metadata to the entry variables of a function. From the docs, you could specify the maximum length of a incoming list such as: Annotated can be used with nested and…
Daniel Azemar
  • 478
  • 7
  • 19
7
votes
2 answers

Module 'PyQt6.QtWidgets' has no attribute 'QDesktopWidget'

I try to run this code, but it always get this AttributeError, I have searched for many website but there wasn't any answer. QtWidgets.QDesktopWidget().availableGeometry().center() AttributeError: module 'PyQt6.QtWidgets' has no attribute…
7
votes
1 answer

When running python 3.9.4 I am unable to import tkinter, but downgrading to 3.8.2 works perfectly fine

Im on macOS Catalina running tcl 8.6.11, I installed python3 using brew install python3 tclsh % info patchlevel 8.6.11 Current version of python 3.9.4 python3 --version Python 3.9.4 >>> import tkinter import _tkinter # If this fails your Python…
Aditya Garg
  • 838
  • 6
  • 19
7
votes
1 answer

Cplex installation "Could not find a version that satisfies..." and "No matching distribution" for Apple M1

I am trying to run cplex on my M1. I am hoping I can get it to run on python 3.8/9 because I also need to run tensorflow (which I run through miniconda for M1). When I try to pip install it within the miniconda python environment, I get the…
chiennifer
  • 135
  • 6
7
votes
4 answers

Open JupyterNotebook from VScode into the Browser

I have opened my .ipynb file with vscode (Python 3.9 Interpreter - installed jupyterlab), it's connected locally, how can I open it through the browser? what is the default port?
7
votes
2 answers

Numpy Installation for Python Ver-3.9

I'm trying to install NumPy but I'm facing an issue. The python ver I'm using is 3.9 and Windows version is 10. The error is as follows: C:\>pip3 install numpy Collecting numpy Using cached numpy-1.19.2.zip (7.3 MB) Installing build dependencies…
Orpheus
  • 219
  • 1
  • 4
  • 9
6
votes
2 answers

Python get the name of all fields in a dataclass

I am trying to write a function to log dataclasses I would like to get the name of all fields in the dataclass and print the value to each (similar to how you might write a function to print a dictionary) i.e. @dataclasses.dataclass class Test: …
Pioneer_11
  • 670
  • 4
  • 19
6
votes
5 answers

React to django CORS issue

Error Details Two requests have been generating on button click. What did I search so far? Axios blocked by CORS policy with Django REST Framework CORS issue with react and django-rest-framework but to no avail What am I doing? Submitting POST…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
6
votes
1 answer

ERROR: No matching distribution found for psycopg2-binary==2.8.2

Please how should i install psycopg2-binary on my python image. I tried pip install psycopg2-binary==2.8.2 but i got this error ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.2 (from versions: 2.7.4, 2.7.5,…
charles
  • 209
  • 3
  • 10
6
votes
1 answer

Why does using the walrus operator on a member variable raise a SyntaxError?

Why can't I use the walrus operator := to assign to an attribute? It works when assigning to a local variable: my_eyes = ["left", "right"] if saved_eye := my_eyes.index("left"): print(saved_eye) # outputs >>> 0 But it is a syntax error if I…
Inyoung Kim 김인영
  • 1,434
  • 1
  • 17
  • 38
6
votes
4 answers

ModuleNotFoundError: No module named 'qrcode' python 3.9

I have already installed qrcode library in my command prompt and also updated my command prompt. In the command prompt it says that everything is fine but when I go to PyCharm and type in: import qrcode img = qrcode.make("This is the…
Xotiic
  • 61
  • 1
  • 1
  • 4
6
votes
1 answer

Multiple async unit tests fail, but running them one by one will pass

I have two unit tests, if I run them one by one, they pass. If I run them at class level, one pass and the other one fails at response = await ac.post( with the error message: RuntimeError: Event loop is closed @pytest.mark.asyncio async def…
Houman
  • 64,245
  • 87
  • 278
  • 460
6
votes
3 answers

Can't install tensorflow on python 3.9

When I try to install tensorflow on python 3.9 I get following error: ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow Is not there any tensorflow…
6
votes
2 answers

How can I install Python 3.9 from the Anaconda prompt?

Python 3.9.0rc1 has been released today, according to the official website. Is there a way I can use it in an Anaconda environment? I tried conda create --name python39 python==3.9 But it says: ERROR: Could not find a version that satisfies the…
Nicolas Gervais
  • 33,817
  • 13
  • 115
  • 143
6
votes
3 answers

Is there a __dunder__ method corresponding to |= (pipe equal/update) for dicts in python 3.9?

In python 3.9, dictionaries gained combine | and update |= operators. Is there a dunder/magic method which will enable this to be used for other classes? I've tried looking in the python source but found it a bit bewildering.
evanr70
  • 139
  • 10
1 2
3
74 75