<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq" -->

---
title: How I Set Up Python for Machine Learning With AI | daily.dev
description: A workflow walkthrough for setting up Python machine learning projects using PyCharm together with AI coding agents. Covers using UV for dependency and virtual...
canonical: https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How I Set Up Python for Machine Learning With AI | daily.dev
og:description: A workflow walkthrough for setting up Python machine learning projects using PyCharm together with AI coding agents. Covers using UV for dependency and virtual...
og:url: https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq
og:image: https://api.daily.dev/og/posts/ylKlaQhnq.png
og:image:alt: How I Set Up Python for Machine Learning With AI
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How I Set Up Python for Machine Learning With AI

**[Tech With Tim](https://daily.dev/sources/TechWithTim)** · 20 min read · 1 upvotes · 0 comments

## Summary

A workflow walkthrough for setting up Python machine learning projects using PyCharm together with AI coding agents. Covers using UV for dependency and virtual environment management, configuring AI chat and multiple model backends (Codex, Claude, LM Studio, Ollama) inside PyCharm, wiring up MCP servers such as GitHub for automated repo actions, creating reusable AI 'skills' for enforcing project conventions, connecting to a remote GPU machine (like a DGX Spark) over SSH via JetBrains Gateway for remote training, using the built-in debugger and data viewer to validate AI-generated ML code, and setting up linting/formatting with Black and Ruff. Emphasizes verifying AI-generated code carefully since machine learning training runs are costly to get wrong.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=cAtKtvmds1o>

## Questions this post answers

### How do I set up a Python virtual environment for a machine learning project using UV?

Run 'uv init .' in the project directory to create a new UV-managed Python project, which generates a .gitignore, .python-version file, main.py, pyproject.toml, and readme.md. The pyproject.toml tracks all package versions, and running 'uv run main.py' automatically syncs dependencies and executes the script, making it significantly faster than pip-based workflows.

_daily.dev surfaces workflow guides like this for developers standardizing their ML environment setup around uv._

### How can I run Python machine learning training on a remote GPU machine without leaving my local PyCharm editor?

PyCharm's remote development feature, accessed through the JetBrains Gateway, lets you open an SSH connection to a remote machine (such as a DGX Spark GPU box) and run an actual PyCharm instance on that device while keeping your local editor experience. Once connected, scripts like train.py execute directly on the remote hardware, and you can run notebooks against remote Jupyter kernels as well.

_developers offloading heavy training jobs to GPU servers can find setup walkthroughs like this through daily.dev._

### Why is verifying AI-generated code especially important in machine learning projects compared to regular scripting?

Machine learning training runs can take days, so code that merely runs but contains subtle logic errors can waste enormous amounts of compute and time before the mistake is caught. Using a debugger to inspect actual tensor and prediction values, rather than trusting that AI-generated code executes without error, is necessary because 'runs' and 'works correctly' are not the same thing in ML.

_daily.dev helps developers stay sharp on practices for validating AI-generated ML code before costly training runs._

## Similar posts on daily.dev

- [Creating Our Python AI Project](https://daily.dev/posts/creating-our-python-ai-project-nauipcbxc) · We Are .NET · 1 upvotes · 0 comments
- [PyCharm for AI-assisted Django Workflows](https://daily.dev/posts/pycharm-for-ai-assisted-django-workflows-iuiwofvck) · JetBrains · 0 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#python](https://daily.dev/tags/python), [#devtools](https://daily.dev/tags/devtools), [#ai-agents](https://daily.dev/tags/ai-agents)

[View this post on daily.dev](https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How I Set Up Python for Machine Learning With AI","url":"https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq"},"datePublished":"2026-08-26T14:16:08.674Z","dateModified":"2026-08-26T14:16:39.663Z","description":"A workflow walkthrough for setting up Python machine learning projects using PyCharm together with AI coding agents. Covers using UV for dependency and virtual...","image":"https://i.ytimg.com/vi/cAtKtvmds1o/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/cAtKtvmds1o/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Tech With Tim","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Tech With Tim","logo":"https://media.daily.dev/image/upload/s--6vVIDfU0--/f_auto/v1711726146/logos/TechWithTim","url":"https://daily.dev/sources/TechWithTim"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"machine-learning,python,devtools,ai-agents","timeRequired":"PT20M","video":{"@type":"VideoObject","name":"How I Set Up Python for Machine Learning With AI","description":"A workflow walkthrough for setting up Python machine learning projects using PyCharm together with AI coding agents. Covers using UV for dependency and virtual...","thumbnailUrl":"https://i.ytimg.com/vi/cAtKtvmds1o/sddefault.jpg","uploadDate":"2026-08-26T14:16:08.674Z","duration":"PT20M","url":"https://api.daily.dev/r/ylKlaQhnq","embedUrl":"https://www.youtube.com/embed/cAtKtvmds1o"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Tech With Tim","item":"https://daily.dev/sources/TechWithTim"},{"@type":"ListItem","position":3,"name":"How I Set Up Python for Machine Learning With AI"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-i-set-up-python-for-machine-learning-with-ai-ylklaqhnq#faq","mainEntity":[{"@type":"Question","name":"How do I set up a Python virtual environment for a machine learning project using UV?","acceptedAnswer":{"@type":"Answer","text":"Run 'uv init .' in the project directory to create a new UV-managed Python project, which generates a .gitignore, .python-version file, main.py, pyproject.toml, and readme.md. The pyproject.toml tracks all package versions, and running 'uv run main.py' automatically syncs dependencies and executes the script, making it significantly faster than pip-based workflows. daily.dev surfaces workflow guides like this for developers standardizing their ML environment setup around uv."}},{"@type":"Question","name":"How can I run Python machine learning training on a remote GPU machine without leaving my local PyCharm editor?","acceptedAnswer":{"@type":"Answer","text":"PyCharm's remote development feature, accessed through the JetBrains Gateway, lets you open an SSH connection to a remote machine (such as a DGX Spark GPU box) and run an actual PyCharm instance on that device while keeping your local editor experience. Once connected, scripts like train.py execute directly on the remote hardware, and you can run notebooks against remote Jupyter kernels as well. developers offloading heavy training jobs to GPU servers can find setup walkthroughs like this through daily.dev."}},{"@type":"Question","name":"Why is verifying AI-generated code especially important in machine learning projects compared to regular scripting?","acceptedAnswer":{"@type":"Answer","text":"Machine learning training runs can take days, so code that merely runs but contains subtle logic errors can waste enormous amounts of compute and time before the mistake is caught. Using a debugger to inspect actual tensor and prediction values, rather than trusting that AI-generated code executes without error, is necessary because 'runs' and 'works correctly' are not the same thing in ML. daily.dev helps developers stay sharp on practices for validating AI-generated ML code before costly training runs."}}]}
```

