Questions tagged [python-3.11]

Python 3.11 is the newest release of the Python language. Please use the [python] tag for general Python related questions.

Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation.

References

308 questions
1
vote
1 answer

Error importing docx after installing python-docx (running on Mac, using PyCharm, Python 3.11)

I installed python-docx and when importing docx, I get some errors. I am using a MAC, Python 3.11, PyCharm. Does anyone knows how to solve this? Btw, I am a beginner in coding and in Python... please explain as you would to a four year old XD. I…
Bencho Mat
  • 11
  • 1
1
vote
1 answer

Using email.message to parse an HTTP POST request?

With the deprecation of the standard cgi library in favor of WSGI starting in Python 3.11, the documentation alleges: The FieldStorage class can typically be replaced with … the email.message module or [3rd-party] multipart for POST and…
1
vote
0 answers

No pyvenv.cfg what does this mean

When I run python --version in terminal, it displays: No pyvenv.cfg file What does it mean and how can I fix it? I was running command in terminal after downloading the compiler.
1
vote
0 answers

Get user input with only standard Python 3.11.2 modules

I have a problem on getting user input. I do not like the keyboard module because it requires root user and the pynput module blocks the entire script. I tried this and it is pretty fast for normal request but when I have two loops, it is nearly…
Muddyblack k
  • 314
  • 3
  • 16
1
vote
0 answers

How do I build tensorflow-directml-plugin for Python 3.11?

I tried to build a tensorflow-directml-plugin whl for Python 3.11.3, but unfortunately the build instructions from the build.md file only gives me error after error, when I supposedely fixed the one, another error occurres and when I fix that one…
1
vote
1 answer

Error while finding module specification for 'spyder_kernels.console' (ModuleNotFoundError: No module named 'spyder_kernels')

I just upgraded python from 3.10 to 3.11.2 If I check in a windows powershell it was successful and is now the default interpreter. However, when I try to change the interpreter in Spyder I get the following error: C:\Program…
Tom
  • 109
  • 9
1
vote
0 answers

Python based .exe file running but not working on another machine and sometimes throwing wmi.py exception

I am trying to create an .exe file that would be called repeatedly by windows to kill a certain process in case it is running too long (it is stuck). I want it to be general, so it requires three command line parameters: number of minutes (as a…
1
vote
0 answers

Convert new version python compatible code to an older version of python

I have a python code with full explaination of what it does in these questions Scrape text file with Python Modify python code to include user input search feature The code I have is compatible with 3.11 version of python and not with 3.8, I am…
1
vote
1 answer

lru_cache not working 3.11; cache_info() remains the same after multiple runs

I am testing lru_cache for the first time. A simple request. The code works fine but multiple runs of the code do not change cache_info() import requests from functools import lru_cache url = 'http://www.python.org/dev/peps/pep-' my_list = [290,…
marqeu
  • 11
  • 3
1
vote
1 answer

Python poetry install fails on typed-ast (1.5.4). How to overcome the obstacle and install the package?

I tried to install the package using pip: pip wheel --use-pep517 "typed-ast (==1.5.4)" but it falls in the same place. What's the general approach when you walk into such kind of problems? I've found this thread, which seemed to be helpful, but it…
yevt
  • 732
  • 1
  • 6
  • 21
1
vote
1 answer

asyncio TaskGroup throwing TypeError when returning lists

I am trying to use the new TaskGroup object in Python 3.11 to return lists, and I am struggling to find the correct syntax. There isn't much example code out there yet for this new feature, so I figured I'd ask. import asyncio async def…
sha2fiddy
  • 45
  • 6
1
vote
1 answer

How to find "os" module file path in Python3.11 without importing it?

I can get the path of 'os.py' like this: import os os.__file__ But how can I get it without importing it? I found this relevant question, but none of these work for Python3.11 , although they work for Python<=3.10 . It seems that the newly…
tamuhey
  • 2,904
  • 3
  • 21
  • 50
1
vote
0 answers

Python 3.11 installing repl-cli: setuptools not found even it's installed

That's it. I am installing repl-cli but it's giving "ModuleNotFoundError: No module named 'setuptools'". I tried: pip install setuptools Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied:…
Bitenco
  • 11
  • 1
  • 3
1
vote
1 answer

(Why) is there a performance benefit of using list.clear?

I've recently noticed that the built-in list has a list.clear() method. So far, when I wanted to ensure a list is empty, I just create a new list: l = []. I was curious if it makes a difference, so I measured it: $ python --version Python 3.11.0 $…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
1
vote
2 answers

VS Code + Pylance does not find venv-installed modules while venv is activated

I use VS Code Version: 1.74.3 on MacOS 13.2. python -V returns Python 3.11.1. I get the following error message: Import "django.shortcuts" could not be resolved from source Pylance(reportMissingModuleScource). As you can see in the screenshot, the…
tjati
  • 5,761
  • 4
  • 41
  • 56