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
Linux Mastering Development Ubuntu

Python dist-packages UnicodeDecodeError when upgrading from 19.04 to 19.10

I tried to run the do-release-upgrade to upgrade from ubuntu 19.04 to 19.10. Unfortunately i get an error traceback pointing to python dist-packages. I replaced the dist_info.py like described in Problem with upgrading 19.04 to 19.10 “UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x8b in position 1: invalid start byte without any success. I have no […]

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
Development

Error while trying to run dsample project with django

I am getting the error while trying to run a project in django. The error is : Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): I have installed it in the virtual environment. The detailed error included below (venv) D:\djEnv\t2>python3 manage.py runserver Watching for file changes with StatReloader […]

Categories
Development

Python EEL and PyInstaller Issue

i’ve recently crated a program using eel, in this program i used the module moviepy to split the audio and the video from a file. But when i try to put the whole project into an .exe file with PyInstaller, the app won’t work. the command I used is: python -m eel main.py web I […]

Categories
Development SQL

SQLite 3.8.3 or later is required (found 3.7.17)

I completed my project and uploaded into the host using cpanel and install all my necessary packages. but now when run the server I have this error : Traceback (most recent call last): File “/opt/alt/python37/lib64/python3.7/threading.py”, line 917, in _bootstrap_inner self.run() File “/opt/alt/python37/lib64/python3.7/threading.py”, line 865, in run self._target(*self._args, **self._kwargs) File “/home/mahdiade/virtualenv/portfolio/3.7/lib/python3.7/site-packages/django/utils/autoreload.py”, line 54, in wrapper fn(*args, […]

Categories
Development Django

Converting Django project from Python 2 to Python 3: django.core.exceptions.AppRegistryNotReady: Apps aren’t loaded yet

I am converting a Django website from Python 2 to Python 3. To do this, I ran 2to3 on the whole project. Now, upon running the server (which works fine in Python 2). Now, there appears to be an error django.core.exceptions.AppRegistryNotReady: Apps aren’t loaded yet. that seems to originate with an issue loading the django_comments […]

Categories
Chrome Development Drivers Windows

how do you fix the executable error with chromedriver Windows >>> in a transition to Ubuntu?

My goal is to execute a script i’ve used previously on windows, transitioned to chromedriver and there’s this error: Blockquote selenium.common.exceptions.WebDriverException: >> Message: ‘chromedriver’ executable needs to be in the PATH. the windows exe file is in the PATH and works with windows. I’ve replaced that chromedriver with an up to date version of Linux […]

Categories
Database Development Django

How correct open connections to database in Python/Django

I want know how open correctly new connection to database. A problem rise when i want create single QUERY to database, from many places in my code. For example, one request is sent to database from login.html , second from register page, third to gallery in index.html . I guess , should i use some […]

Categories
Development

Getting Error in middleware for the mobileesp While porting python2 project to python3

I’m getting the error in the dependencies while porting python2 project with Django 1.1.11 to python 3.7 and Django 2.2.5 I’m using Django-mobileesp in the python2, when I have update the code to python3 it gives the error for the Middleware for the UserAgent. Exception in thread django-main-thread: Traceback (most recent call last): File “/usr/lib/python3.7/threading.py”, […]