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
0 answers

Not able to change python version in windows

I already have python(3.10.5) installed in my windows 10 machine. I have now installed python 3.11.1. I am trying to default setting the python version to 3.11.1 but it not working. I have deleted 3.10.5 version from the environment variable…
Nikhil
  • 101
  • 8
1
vote
1 answer

unable to import PyPDF2 Python 3.11

I have been trying many solutions: but I cannot import PyPDF2 yet. I got the following error. I have already check if the version is right and it says it is already satisfied. I changed the computer twice and used Jupyter notebook and Pycharm…
Thet
  • 11
  • 3
1
vote
1 answer

How can I get an file-like object from Selenium without download a file to a local path?

I'm working on a parser platform. I need to download files, save them directly to the FTP server. For this I have to get file-like object. I don't want to save junk temporary files. I need to use selenium specifically For example: I need to download…
1
vote
1 answer

Why are enum members in Python 3.10 and 3.11 serialized to YAML differently?

Using this snippet: import sys import yaml try: from enum import ReprEnum except ImportError: from enum import Enum as ReprEnum class MyEnum(int, ReprEnum): foo = 123 print('Python version:', ''.join(map(str,…
ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
1
vote
0 answers

Add icons to a button widget using the tkinter library in python in a for loop

I am relative new to python and was hoping to create a button with a icon in the side dynamically using tkinter, to do that I have a list dictionary with all the button preloaded with the information I need and using a for loop to create and store…
Mufaddal
  • 11
  • 3
1
vote
1 answer

DataClassWizard after upgrading to python3.11 is not working as expected

Consider this following code: @dataclass class Subjects(JSONWizard): subjectName: str =None subjectExpert: str = None subjectScore: float = None @dataclass class Student(JSONWizard): studentName: str studentId: str subjects:…
Sai Naveen
  • 19
  • 3
1
vote
0 answers

I installed 3.11.4 in python but anaconda prompt shows 3.10.11 - why and should I upgrade in anaconda?

Do I need to upgrade within anaconda itself ? Why does it show 3.10.11 under anaconda? Should it show the latest version I installed ? If yes what do I need to do to upgrade it within anaconda? Do they both should match or it does not matter?
Hellov
  • 21
  • 3
1
vote
1 answer

Unable to call .dict() method on custom Pydantic models (exception: TypeError: unhashable type: 'dict')

I am new to dataclasses/Pydantic models and I am running into an issue elaborated below. I have defined two pydantic models Roles and SubRoles such that Role model contains a set of SubRoles. """ Module contains all the models. """ # pylint:…
DDStackoverflow
  • 505
  • 1
  • 11
  • 26
1
vote
0 answers

Resolve issue building wheel for numpy on freebsd

I'm having trouble getting numpy installed on in a freebsd jail (13.2-release) (truenas). I've got python 3.11.3 installed and am using pip 23.1.2. Specifics are - I can use pkg to install py311-numpy and that works fine, but I need a specific…
RetroChap
  • 33
  • 1
  • 3
1
vote
1 answer

Type-Hinting JSON Object Rigorously

I have a function in my program that takes a JSON as one of its parameters, and I wanted to annotate my function signature as such. I recalled that the loads() function from the built-in json module takes in a str, bytes, or a bytearray (which…
1
vote
2 answers

How would I do a bulk update using Python 3 | psycopg 3.1.8?

In python I have a list of tuples Each tuple has four fields, the first field is the row identifier that would be used in a where clause in a SQL update statement. tuple: (id, status, department, manager_email) update_tuple_list = [ (1, 'ACTIVE',…
user10664542
  • 1,106
  • 1
  • 23
  • 43
1
vote
2 answers

How can I speed up the computation time for applying data cleaning and transformation on a list of dataframes in Python using polars/pandas?

How can I iterate over a large list of polars/pandas dataframes in python with a very fast computation time while simultaneously performing data cleaning/transformation on each dataframe? My problem: I have a huge list of csv files (~1K for…
1
vote
1 answer

How to create tables with Flask and sqlalchemy

Hi I'm trying to learn to build an app in flask using postgresql, but I can't get the database working properly. The tutorial I'm following has the following: from datetime import datetime from flask import Flask from flask_sqlalchemy import…
iFunction
  • 1,208
  • 5
  • 21
  • 35
1
vote
3 answers

PyQt5 QThread is run on same thread as GUI thread

I was attemtping to load thumbnails for QPushButtons on the side, so I created a thread for every image to load (there are only a handful of them for now). I based this code on https://realpython.com/python-pyqt-qthread/. class Worker(QObject): …
1
vote
1 answer

LangChain: ValueError: 'not' is not a valid parameter name

I am using 3.11.3 and langchain 0.0.166 on Windows. When I try and run from langchain.document_loaders import UnstructuredPDFLoader I get an error of ValueError "'not' is not a valid parameter name" It seems like FastAPI had this issue but it's…
A_Arnold
  • 3,195
  • 25
  • 39