Category "python"

How to Convert or Solve a Non-Linear Optimization Problem with Non-Linear Objective Function & Constraints

Overview I am working on an order allocation problem with variable and fixed costs. The initial formulation of this problem was a linear optimization, but when

Using python 3.10, but pylance still says "alternative syntax for unions requires python 3.10 or newer?"

So I just upgraded python to 3.10 for the new features, and when I do import sys; sys.version using the ipython console in vs code, it prints python version 3.1

Using python 3.10, but pylance still says "alternative syntax for unions requires python 3.10 or newer?"

So I just upgraded python to 3.10 for the new features, and when I do import sys; sys.version using the ipython console in vs code, it prints python version 3.1

Django Github CI cannot connect to mysql 'db'

Issue When trying to setup a Github action to test a Django project automatically, we ran into an issue with the django.yml setup. Whenever we ran the .yml, we

WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train

I am trying to run a yolov4 + DeepSORT object tracker on tensorflow. However, when I attempt to run save_model.py to convert the darknet weights of yolov4 to a

Django Github CI cannot connect to mysql 'db'

Issue When trying to setup a Github action to test a Django project automatically, we ran into an issue with the django.yml setup. Whenever we ran the .yml, we

Cannot install Atom packages. npm ERR! code E500

I've just installed Atom and I wanted to install some packages. However, I couldn't do it due to this error: Installing “[email protected]” failed.Hide

In Python how can I overwrite the class attribute of an inherited class, where that attribute is itself an instance of a model?

As in the title, I have a base class ListView, with a Serializer attribute that needs overwriting. For each of my django models I create a child ListView class

Python to Powerpoint: Export svg to a pptx file

I was experimenting with the python-pptx library to automate the process of adding images to my presentations. I used code such as: from pptx import Presentatio

How to install PyQt5 on M1 arm64 architecture?

I have an M1 mac, but I've noticed that whenever native python is running any automation script (like PyAutoGui) it progressively gets slower and slower, almost

PySimpleGuiWeb change ip address

I have a python script that uses PySimpleGuiWeb. I want to host it on my server and connect to it from another computer. But the script is running on 127.0.0.1.

flask-security-too with peewee + mysql not working

After beating my head against the wall for a bit, I've decided I need help from the gurus here on stackoverflow. It's very possible I'm missing something incre

How to compile a py file from another py file by using a module ? (Therefore not Cmd)

I want to make a code (that I'll call compiler.py), that'll compile any py file I need without using cmd commands, only modules(Things that are compilable So I

Using try except in a function

I'm trying to figure out how to get try/except to work within a function. Here is what I have now and it produces a traceback error when I enter anything not nu

Importing Utils in Python

I have Python 3.9.7 and I have already installed utils==1.0.1. So now I want to import this library and trying with this command from . import utils But this

How to get rid of sqlalchemy.exc.NoReferencedTableError?

Here's some code related to the problem: db_session.py import sqlalchemy as sa import sqlalchemy.orm as orm import sqlalchemy.ext.declarative as dec SqlAlchemy

Intercept specific function invocations using parent/child classes?

I am writing a framework that allows us to intercept certain function invocations so that we can manage them(enforce timeouts and retries, persist return

Watch changes in a file and restart python script

I want to restart a python script(restart.py) whenever some edits a file (test.txt) =====restart.py==== from time import sleep for i in range (1000): print

Why get pip install error, when run docker build on only M1 mac

I'm using Intel and Apple Silicon chip Mac. When I build dockerfile on Intel Mac, it is success. How ever when I build same file on M1 Mac I get This error. #1

Trigger Cloud Storage - Dataflow

I'm starting now and I need some help, I have a custom model that I created using apache beam creating a pipeline that takes the data from a csv file from a fol