397 questions
0
votes
1
answer
826
views
FastAPI upload a file and pass it into python-docx's Document
I want to upload an .docx document using FastAPI's method (https://fastapi.tiangolo.com/tutorial/request-forms-and-files/), and then pass that file (using bytes) into python-docx's Document. I've ...
-2
votes
2
answers
5k
views
Lambda Layer || Python Runtime 3.11 || Pyodbc-Lib
Can you please assist me adding the python pyodbc layer for 3.11 python runtime version? Earlier, i had the pyodbc layer for 3.7 which i exported from https://github.com/kuharan/Lambda-Layers?source=...
1
vote
2
answers
1k
views
Writing to excel in VS Code using Python 3.11.4
So I have some code that I was able to execute in Anaconda (for testing) and now I am trying to implement at work where we use VS Code. The script runs almost entirely with the exception of the last ...
2
votes
0
answers
2k
views
Unable to import module 'lambda_function': No module named 'psycopg2._psycopg'
I have used docker to create a zip package for psycopg2. Below are the commands,
pip3 install psycopg2 -t layer/python/lib/python3.11/site-packages/
cd layer
zip -r layerpsycopg2.zip *
Have uploaded ...
0
votes
1
answer
276
views
In Python, how would you properly annotate a function to show the same return type as a function of a class member?
I'm using Python 3.11 with mypy as my type checker. Here's an example of what I'm trying to do.
from dataclasses import dataclass
from abc import ABC, abstractmethod
from typing import Any, TypeVar, ...
0
votes
2
answers
3k
views
python version 3.11.3 installation
iam trying to install pip install Package but my pc is not working anyone can resolve my issue
and it showing ######"C:\Users\91703>pip install virtualenv
Fatal error in launcher: Unable to ...
2
votes
0
answers
301
views
Python 3.11.5 - Error Enabling jupyter_nbextensions_configurator: ModuleNotFoundError for notebook.base
I'm encountering an issue when trying to enable jupyter_nbextensions_configurator on my Jupyter setup. I get the following error message:
jupyter_nbextensions_configurator | error adding extension (...
0
votes
0
answers
58
views
Error during indexing a list with another list
I am trying to encode a text using by using indices stored as a list and refer that indices as a value of another list.
There is a code:
#The part of a code that creates indices for input text ...
0
votes
1
answer
82
views
"Unicode Blank Symbol Rendering Issue after Updating to Python 3.11 and Django 4.1.7"
I'm facing an issue with rendering a Unicode blank symbol in my Django project after upgrading to Python 3.11 and Django 4.1.7. Previously, I was using the following code snippet in my MyForm class:
...
-1
votes
1
answer
63
views
Why does my pygame.draw.rect() keep drawing in the main code without the background? [duplicate]
Here is the code with the background in the main code. I cannot figure out what is wrong.
import pygame
import random
pygame.init()
width, height = 800, 400
win = pygame.display....
1
vote
1
answer
96
views
Structural pattern matching of lxml HtmlElement attributes
I want to use PEP 634 – Structural Pattern Matching to match an HtmlElement that has a particular attribute. The attributes are accessible through an .attrib attribute that returns an instance of the ...
0
votes
3
answers
1k
views
using packages from functions with layers
I'm trying for some time to solve this issue and it will be nice if anyone had some similar case.I'm building some program on aws lambda and need to use scikit-learn package.
The issue is that this ...
-1
votes
2
answers
97
views
diffrent results in jupter notebooks and in chatgpt
This is what ChatGPT replied after i asked if my code was correct, but this the result I'm getting in Jupyter notebooks
Can someone explain what what am I doing wrong and how to correct it?
5
votes
1
answer
3k
views
/opt/python/cryptography/hazmat/bindings/_rust.abi3.so: cannot open shared object file in aws lambda layer stack: Runtime.ImportModuleError
I'm facing an issue with my AWS Lambda Layer Stack using AWS SAM (Serverless Application Model). I am encountering a Runtime.ImportModuleError with the following error message:
Runtime....
-1
votes
1
answer
45
views
How to find data with specific tags in Python using requests module?
This is the current HTML part that I need to get something from.
<table class="table table-hover sortable-theme-minimal table-heatmap" data-sortable="">
<thead>
<...
2
votes
1
answer
3k
views
VS code error: import "requests" could not be resolved from source
When I try to 'import requests' in my views.py, why is Visual Code Studio throwing this error:
import "requests" could not be resolved from source Pylance
A screenshot of the configuration ...
0
votes
1
answer
1k
views
Unable to install PaddleOCR on Python 3.11 with GitHub Actions on Windows OS
I am trying to automate the installation of PaddleOCR using GitHub Actions for my project. The process works smoothly on other Python versions and operating systems.
However, I am encountering an ...
1
vote
0
answers
107
views
Python 3.11, pipenv éditable package
I have my python 3.11 project here: E:/DEV/CUSTOMER/MYPROJECT
I have created virtualenv inside my project with PIPENV_VENV_IN_PROJECT so my virtual env is in E:/DEV/CUSTOMER/MYPROJECT/.venv
I have ...
0
votes
1
answer
509
views
Error while installing python-snappy on ubuntu with python3.11 version, fatal error: snappy-c.h: No such file or directory
I am facing below error while installing python-snappy on ubuntu. I am using python-snappy==0.6.1 version. This package worked with python3.8 however I am seeing issue with python3.11 version.
Running ...
2
votes
0
answers
261
views
Subclassing typing.Any
The documentation for typing.Any says
Changed in version 3.11: Any can now be used as a base class. This can be useful for avoiding type checker errors with classes that can duck type anywhere or are ...
5
votes
1
answer
795
views
pipenv install throws "Requirement" object has no field "use_pep517"
Upgraded python (using pyenv) to 3.11.4
Upgraded pipenv to 2023.7.23 version.
pipenv lock works successfully.
However, pipenv install or pipenv sync -d throws errors.
File "/Users/kkannar/.pyenv/...
0
votes
1
answer
3k
views
Selenium chrome driver error on Docker Container
in my local test the code is perfectly worked
but when i build the docker, after run a docker image,
"selenium.common.exceptions.WebDriverException: Message: Service /root/.wdm/drivers/...
0
votes
1
answer
444
views
requests.get url json but for selected columns/field
I have a sample dataset looking like this:
"id": 1,
"name": "meow",
"address": "123 meowmeow St, city, state 12345",
"...
0
votes
1
answer
189
views
Invalid behavior of __main__.py and __init__.py files
I am currently working on a Python package. The package can be imported or it can also run from command line with -m switch. Inside the package I am building a dependency injection container using - ...
1
vote
1
answer
848
views
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 ...