Skip to main content

153 posts tagged with "Python"

Python Programming Language

View All Tags

How to Change the MLflow Server Port

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

The MLflow tracking server listens on port 5000 unless you tell it otherwise. That port is often taken: on a Mac, the AirPlay Receiver already holds it, and other programs like it too. One option moves MLflow to any free port. This guide changes the port, checks what's using a port, and keeps your code pointed at the right address.

How to Start an MLflow Tracking Server on Your Computer

· 11 min read
Jagdish Kumawat
Founder @ Dewiride

The MLflow tracking server is the place your training runs go: a small web server that stores every run and shows them in the MLflow UI. You don't need a cloud account or a database server to run one; MLflow 3.18 brings everything, including a SQLite database. This guide starts a server on your own computer, explains every line it prints, checks that it's ready, and stops it safely.

How to Install MLflow in a Python Project with uv

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

MLflow installs like any Python package, but it brings a lot with it: a web server, a database layer and the most common data science libraries. Installing it into a uv project keeps all of that inside the project and records the exact versions. This guide installs MLflow 3.18.0, checks it, and explains which of MLflow's three packages you need.

How to Load Settings from Environment Variables and a .env File with pydantic-settings

· 10 min read
Jagdish Kumawat
Founder @ Dewiride

Hard-coding a port, a database address or a password into your code means editing the code for every computer it runs on. pydantic-settings reads those values from environment variables and a .env file instead, checks them, and gives your code typed values. This guide explains the syntax first, then builds the settings of a small demo app and shows, with real output, which source wins and what happens when a value is wrong.

How to Check the Installed Version of a Python Package with uv

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Before you follow a guide, report a bug or upgrade, you need to know exactly which version of a package your project runs. In a uv project the answer is in the project's own environment, not in your computer's Python. This guide gives the syntax of four ways to read it first, then uses each one on a small hello-world project, with real output from uv 0.13.9.

How to Run a Python Script with uv run

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

You added a package with uv, ran your script with python3, and got ModuleNotFoundError. The package is installed, just not in the Python you started. uv run runs everything inside the project's own environment, and brings that environment up to date first. This guide explains the command's syntax first, then runs a small script, a project command and a tool in a hello-world project, with real output from uv 0.13.9.

How to Add a Package to a Python Project with uv

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

uv add installs a package into your project and records it, all in one step. It updates pyproject.toml, writes the exact versions to uv.lock, and installs everything into the project's own environment. This guide explains the command's syntax first, then adds a package and two development tools to a small hello-world project, with real output from uv 0.13.9.

Fixed: "TypeError: got an unexpected keyword argument 'squared'" in scikit-learn mean_squared_error

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

mean_squared_error(y_true, y_pred, squared=False) is how many tutorials calculate RMSE. In scikit-learn 1.9.1 it fails with TypeError: got an unexpected keyword argument 'squared': the argument was deprecated in scikit-learn 1.4 and has since been removed. root_mean_squared_error() does the same calculation.

Fixed: "MlflowException: API request to … failed with exception … Max retries exceeded" Connection Refused in MLflow

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

An MLflow training run printed seven urllib3 retry warnings over about four minutes, then failed with MlflowException: API request to … failed with exception … Max retries exceeded … [Errno 61] Connection refused. Nothing was listening at the tracking URI. MLflow's client retries for minutes before it gives up, which makes a missing server look like a hang. Starting the server fixed it, and MLFLOW_HTTP_REQUEST_MAX_RETRIES makes the same mistake fail in seconds.