Categories
Mastering Development

Rasbian Lite: email Python Package install (No module named ‘cStringIO’)

Sorry for possible duplicate. I am using Rasbian Lite OS. When I try to install package email: pi@raspberrypi:~ $ sudo pip3 install email I get error message: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting email Using cached email-4.0.2.tar.gz (1.2 MB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] […]

Categories
Mastering Development

Unable to pass arguments in python3 class

Firstly, I created a class that has __init__() on it in models.py, as you can see below. And when I import it in my views.py, the vscode intellisense also shows that my class takes 4 arguments. But when I try to run the program, it shows me an error saying that the class doesn’t take […]

Categories
Mastering Development

Issue with google library in python

I am running into an error when importing the below library from google.cloud import vision The error message I receive is : Traceback (most recent call last): File “d:/UnmatchedOTMProcess/ImageDetection_test.py”, line 2, in <module> from google.cloud import vision File “C:\Users\mhancock\AppData\Roaming\Python\Python38\site-packages\google\cloud\vision.py”, line 17, in <module> from google.cloud.vision_v1 import ImageAnnotatorClient File “C:\Users\mhancock\AppData\Roaming\Python\Python38\site- packages\google\cloud\vision_v1\__init__.py”, line 27, in <module> from […]

Categories
Mastering Development

How to batch rename video files with quality information using python?

I was trying to write a program to rename all the video files of a folder. I just wanted to add video quality or dimension like (720p) or (1080p) or something like that to the end of the current file name. But I’m getting the following error: Traceback (most recent call last): File “f:\Python Projects\Practice\mm.py”, […]

Categories
Mastering Development

python – cant parse text from a site but from mine can

im strugling with a site here is my code import csv from bs4 import BeautifulSoup page = requests.get(‘https://fmdataba.com/20/p/220045/diego-barbosa’,headers = {‘User-agent’: ‘Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36’}) soup = BeautifulSoup(page.text, ‘html.parser’) physical = {} technical = {} table = soup.find_all(‘table’,{‘class’:’table tab61′}) print(len(table)) trs = table[0].find_all(‘tr’) for tr in trs: tds […]

Categories
Mastering Development

Why does running “Jupyter notebook”command in Anaconda prompt gives attribute error?

This must really simple. Running jupyter notebook in the Anaconda prompt gives me an attribute error. Traceback (most recent call last): File “D:\anaconda\Scripts\jupyter-notebook-script.py”, line 6, in <module> from notebook.notebookapp import main File “D:\anaconda\lib\site-packages\notebook\notebookapp.py”, line 80, in <module> from .services.contents.manager import ContentsManager File “D:\anaconda\lib\site-packages\notebook\services\contents\manager.py”, line 17, in <module> from nbformat import sign, validate as validate_nb, ValidationError […]

Categories
Mastering Development

MySQL 5.7: fine tuning for too many connections error

I have an old django 1.9 application connected to a mysql 5.7 database. Sometime I get this error: [Fri Mar 20 10:27:19.482820 2020] [wsgi:error] [pid 15215] ” [Fri Mar 20 10:28:20.502889 2020] [wsgi:error] [pid 15215] [NXU ts_fw20] [2020-03-20 Fri 10:28:20.1584696500]ERROR “Exception during GET request (user: AnonymousUser): <QueryDict: {u’udid’: [u’B8663A17-C121-4691-A561-E0F698CDD4EA’], u’client_os_version’: [u’13.3.1′], u’client_app_version’: [u’11.30.1.201910161040′], u’client_app_type’: [u’Jukebox’], […]

Categories
Mastering Development

super().__init__(*args, **kwargs) TypeError: __init__() got an unexpected keyword argument ‘max_lenght’

Traceback (most recent call last): File “manage.py”, line 21, in <module> main() File “manage.py”, line 17, in main execute_from_command_line(sys.argv) File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py”, line 401, in execute_from_command_line utility.execute() File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py”, line 377, in execute django.setup() File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\__init__.py”, line 24, in setup apps.populate(settings.INSTALLED_APPS) File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\registry.py”, line 114, in populate app_config.import_models() File “C:\Users\MobilineWest\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\config.py”, line 211, in import_models self.models_module = […]

Categories
Mastering Development

python pip corrupted, can’t repair or uninstall

Due to a series of events described later I am getting the following error in the command prompt whenever I try to do anything with pip. (venv) (base) C:\Users\Mark Kortink\Dropbox\Python\projects\metapplica>pip install flask Traceback (most recent call last): File “C:\ProgramData\Anaconda3\lib\runpy.py”, line 193, in _run_module_as_main “__main__”, mod_spec) File “C:\ProgramData\Anaconda3\lib\runpy.py”, line 85, in _run_code exec(code, run_globals) File “C:\Users\MARKKO~1\Dropbox\Python\projects\METAPP~1\venv\Scripts\pip.exe\__main__.py”, […]

Categories
Mastering Development

Why does Firebase say my app both does not exist and already exists at the same time?

I’m trying hard to initialize my Firebase app in my Python project. I’m only doing this initialization in one place, but I keep getting errors about my app already existing. In an effort to fix the problem, I changed my initialization code to try to catch the errors: class Firestore(Datastore): _app: firebase_admin.App _db: firestore.client def […]