<!-- 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 virtual environment and Python project managed by UV. This generates a .gitignore, .python-version, main.py, pyproject.toml, and readme.md. The pyproject.toml tracks dependencies and versions, and running the project with 'uv run' automatically installs or syncs dependencies, making it significantly faster than pip.

_daily.dev surfaces workflow guides like this for developers standardizing their machine learning environment setup._

### How can I run Python machine learning training on a remote GPU while staying in my local IDE?

PyCharm's remote development feature, accessed through the JetBrains Gateway, lets you connect to a remote machine over SSH and open a full IDE session on that device while keeping your local editor experience. Code, terminal, and the run/debug tools all execute on the remote GPU box (such as a DGX Spark), so heavy training runs without loading your own machine.

_developers offloading heavy training jobs to remote hardware often track setups like this on daily.dev._

### How do I verify that AI-generated machine learning code is actually correct before running a long training job?

Use a debugger with breakpoints to step through the code and inspect actual runtime values, such as prediction arrays, rather than trusting that code which runs is code that works. PyCharm's data viewer lets you inspect tensors as arrays, heat maps, or images, which helps catch subtle correctness issues in AI-generated training and evaluation scripts before committing to multi-day training runs.

_anyone validating AI-generated code before a costly training run can follow workflows like this on daily.dev._

## 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-09-13T19:21:34.026Z","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 virtual environment and Python project managed by UV. This generates a .gitignore, .python-version, main.py, pyproject.toml, and readme.md. The pyproject.toml tracks dependencies and versions, and running the project with 'uv run' automatically installs or syncs dependencies, making it significantly faster than pip. daily.dev surfaces workflow guides like this for developers standardizing their machine learning environment setup."}},{"@type":"Question","name":"How can I run Python machine learning training on a remote GPU while staying in my local IDE?","acceptedAnswer":{"@type":"Answer","text":"PyCharm's remote development feature, accessed through the JetBrains Gateway, lets you connect to a remote machine over SSH and open a full IDE session on that device while keeping your local editor experience. Code, terminal, and the run/debug tools all execute on the remote GPU box (such as a DGX Spark), so heavy training runs without loading your own machine. developers offloading heavy training jobs to remote hardware often track setups like this on daily.dev."}},{"@type":"Question","name":"How do I verify that AI-generated machine learning code is actually correct before running a long training job?","acceptedAnswer":{"@type":"Answer","text":"Use a debugger with breakpoints to step through the code and inspect actual runtime values, such as prediction arrays, rather than trusting that code which runs is code that works. PyCharm's data viewer lets you inspect tensors as arrays, heat maps, or images, which helps catch subtle correctness issues in AI-generated training and evaluation scripts before committing to multi-day training runs. anyone validating AI-generated code before a costly training run can follow workflows like this on daily.dev."}}]}
```

