How to use multiprocessing queue in Python?

I'm having much trouble trying to understand just how the multiprocessing queue works on python and how to implement it. Lets say I have two python modules that access data from a shared file,...

uploading files with urllib to a FileField model in Django

I have a django file model that has a models.FileField field and a form that is used to upload files to the server: class UploadFile(model.Model): filename =...

Can I change the connection pool size for Python's "requests" module?

(edit: Perhaps I am wrong in what this error means. Is this indicating that the connection pool at my CLIENT is full? or a connection pool at the SERVER is full and this is the error my client...

Max retries exceeded with URL in requests

I'm trying to get the content of App Store > Business: import requests from lxml import html page = requests.get("https://itunes.apple.com/in/genre/ios-business/id6000?mt=8") tree =...

TemplateDoesNotExist at / base/index.html when deploying to heroku

I've been working on this issue for days and I would really love some real help here! :) I'm brand new to Python, Django, and stackoverflow, so please let me know if more information or a...

Google Play Developer API - "The current user has insufficient permissions to perform the requested operation."

I have a Google dev console process with Google Play Developer API is enabled and the project is linked to Google Play project. In Google Dev console project, created OAuth Client ID (web...

Passenger running Flask site returning 500 error on Dreamhost

I am having trouble getting Passenger to work with Flask. I am running the Flask site on DreamHost inside a virutalenv running Python 3.5.2. The application should receive input from a query...

Python requests - quickly know if response is json parsable

I wrote a certain API wrapper using Python's requests library. When it gets a response using requests.get, it attempts to parse as json and takes the raw content if it doesn't work: resp =...

Python - Request being blocked by Cloudflare

I am trying to log into a website. When I look at print(g.text) I am not getting back the web page I expect but instead a cloudflare page that says 'Checking your browser before accessing' import...

Getting [Errno 110] 'Connection timed out' when trying to do get requests in python

I am able to access the below "URL" mentioned in code manually in firefox browser and see the json response as : { "version" : "1.0", "email_address" : "[email protected]" } But when I am...

Django REST Framework: 'BasePermissionMetaclass' object is not iterable

Python/Django n00b moving over from javascript. Trying to add an API endpoint using Django REST Framework which I'm hoping will ultimately be able to update a User with the body of a PATCH...

UnicodeDecodeError: 'ascii' codec can't decode byte 0xf2 in position 6: ordinal not in range(128)

i'm trying to work with a file .pkl. Here is my code import pickle with open('C:\\Users\\Utilizador\\Desktop\\teste\\teste.pkl', 'rb') as f: data = pickle.load(f) It gives me this...

Scrape posts and comments from a public facebook page

It looks like sometime last year, Facebook started severely restricting its Graph API. I've tried different ways to scrape a public facebook page but always get the error: HTTP Error 400: Bad...

One or more parameter values were invalid: Type mismatch for key xyz expected: S actual: M

My AWS Lambda calls a DynamoDB based on this answer: https://stackoverflow.com/a/33649402/495455 I get an error: One or more parameter values were invalid: Type mismatch for key UserName expected:...

How to aiohttp request post files list python requests module?

I want to multi post using aiohttp. And, I need post with FILE. But, my code dosen't work This is my code import aiohttp file = open('file/path', 'rb') async with aiohttp.request('post', url,...

Python: FastAPI error 422 with post request

I'm building a simple API to test a database. When I use get request everything works fine, but if I change to post I get "unprocessable entity" error: Here is FastAPI code: from fastapi import...

ImportError: cannot import name 'rcParams' from 'matplotlib'

I have tried to uninstall and reinstall matplotlib in my tf-gpu enviornment I made but I keep getting this error: ImportError: cannot import name 'rcParams' from 'matplotlib' This is the entire...

Iterating through a beautiful soup array in python

I just started learning webscraping in python using beautiful soup. I'm trying to access a certain value in an array given from find_all(). I can print out all of the array easily, but I'm having...

OpenCV-python not importing

I am using Pydroid to code in android. Though it is an ARM machine so I downloaded OpenCV-python wheel from PiWheels and successfully installed it using pip. But i can't import OpenCV anyways....

Upload file using fastapi

I am using fastapi to upload file according to the official doc, just like: @app.post("/create_file/") async def create_file(file: UploadFile=File(...)): file2store = await file.read() ...

Pycharm - no django tests found but run in console

I followed this tutorial https://docs.djangoproject.com/en/3.0/intro/tutorial05/ The tests can be run by the command (polls is the application name) python manage.py test polls However under...

Export POST Request from postman to Python

I am attempting to run a POST request in python. When I test in Postman it runs fine and imports the file. When I run it in Python I error out. This posts a spreadsheet stored on my computer into...

Requests format for uploading multiple images in FastAPI

Example Here's my code trying to upload a list of images: import requests import glob import cv2 path = glob.glob("test_folder/*", recursive=True) # a list of image's path lst_img = [] for p in...

How to run an export command within the docker entrypoint?

I'm trying to integrate Datadog APM tracing and log collection to a python application running on Docker. Within the Dockerfile, I need to activate the conda virtual env and export an env...

Bypass hCaptcha with Python requests | Bypass tokens

im trying to make a script to fill out forms. Because I really like sneakers but im tired about all the raffles out there. Its a lot of work to fill out every raffle and I want to automate this. I...

JSONDecodeError: Expecting value: line 1 column 1 (char 0) streamlit API

I am trying to build up an API based on a machine learning model using flask/streamlit. But I am getting an error JSONDecodeError: Expecting value: line 1 column 1 (char 0) I understand it is an...

Cannot pip install mediapipe on Macos M1

Hello fellows I'm using mac air with M1 chip My env sets like (CV) san  ~/work/python  conda list # packages in environment at /Users/san/miniforge3/envs/CV: # # Name ...

How to log raw HTTP request/response in Python FastAPI

We are writing a web service using Python FastAPI that is going to be hosted in Kubernetes. For auditing purposes, we need to save the raw JSON body of the request/response for specific routes....

PIP failed to build package cytoolz

I'm trying to install eth-brownie using 'pipx install eth-brownie' but I get an error saying pip failed to build package: cytoolz Some possibly relevant errors from pip install: ...

How to query graphql issuing post requests with json parameters using google apps script?

I've been trying to scrape the first column from the table of this webpage using google apps script. When I observe network activity in dev tools, I could notice that I have to send post http...