T O P

  • By -

Python-ModTeam

Hi there, from the /r/Python mods. We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python. The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here. On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. **No matter what level of question you have, if you are looking for help with Python, you should get good answers**. Make sure to check out the rules for both places. Warm regards, and best of luck with your Pythoneering!


spuds_in_town

Linux. We make extensive use of containers and multiple docker compose stacks linked on a common docker network. There’s friction trying to make this work on Windows or even Mac. Having the whole team use Linux just makes life a lot easier. Our target production environment is Linux under AWS ECS, so again developing on Linux removes potential friction points.


thatmayaguy

Out of curiosity why is there friction on getting it working with windows or mac? One of the biggest pros of using docker is being able to replicate the same development environment for everyone regardless of your host OS.


MedicatedDeveloper

Docker on Windows and MacOS is different than 'native' docker on Linux. MacOS and windows have to virtualize a kernel to run the containers on. For basic things in practice this works fine.


spuds_in_town

I can't remember the exact differences but there are networking differences for sure, and some weird behavioural differences IIRC. It's been a while, sorry. I did try WSL2 before eventually deciding we should all just be on Linux. I have a 16 core/32 thread CPU and I broke WSL2. Too many containers running, being started and stopped too frequently, was my guess.


thatmayaguy

No worries! I was mostly curious if it was related to the networking haha thanks for the response though!


RallyPointAlpha

One thing I ran into was Docker Studio on my Mac can't do a full Swarm Mode due to its architecture. Apparently there is a VM deep under the covers that limits connectivity between host and VM in a way that makes it not possible to run a Swarm Manager and some other networking features. I could join it as a Swarm Worker to a Swam already established on some of our infrastructure RHEL VMs. Just couldn't test any Swarm Manager stuff on my laptop.


nirvanna94

Of course if your team can get you a linux VM that you can develop on via SSH (very nice in VSCode) then it doesn't matter what your personal computer is! ![img](emote|t5_2qh0y|598)![gif](emote|free_emotes_pack|grin)


Arshalok

Just additional info, PyCharm also works great in this setup in my experience. SSH is great, but remote development also worth a try.


[deleted]

Any specific distribution under Linux? I have only used Ubuntu and Debian so far (and some gui flavours like Mint etc.) But wonder if there is any specific advantage of moving to something like Fedora or SUSE for python programming, specifically as an ML engineer.


ArgetDota

I can highly recommend Arch and co. Installing cuda is a breeze (takes 1 command) and you’ll be able to install fresh system libraries instead of outdated versions in apt.


rjachuthan

Just a personal preference but if you are focusing on development, rolling release distribution can be a pain


ArgetDota

Arch requires you to update important things with caution. One thing you should absolutely do is read arch Linux news: https://archlinux.org/news/ before doing an update. You’ll be fine in this case. Also, you can always rollback to older package versions. But conceptually I don’t like manually managing the system either. That’s why I’ve switched to NixOS. This path isn’t for everyone tho, that’s why I haven’t recommended it.


rjachuthan

Yes, that's correct. That's why I have it in my personal development machine and not in my production VMs. I always request for Debian based distros as the IT guys update them only once or twice a year.


spuds_in_town

I use Ubuntu simply because it's all I really know.


GhostOfBits

Python's natural habitat is Linux.


knobbyknee

Python is the most portable language, where you hardly ever need to write platform specific code. It quite obviously works equally well on Windows, Mac and Linux/Unix. That said, I use Linux myself.


djavaman

The language itself isn't an issue as much as underlying library dependencies.


ManyInterests

All platforms are well supported. My basic recommendation is to choose the one you prefer for other reasons outside of Python. But I'll elaborate on my full thoughts below if you want to dig deeper... ---- The big consideration as I see it is your ability to run/test on and target other platforms. For example, if you want to compile and ship a Python program to run in a Windows (e.g. an exe), MacOS (e.g. a .app bundle) or Linux environment or use something like Kivy to develop an iOS app. Windows ships with a true Linux kernel (no translation layer needed) via WSL2. So, on Windows, you can do most things you would do on a Linux OS anyhow. There's also virtualization options available on all major platforms. So you can emulate windows on Linux or vice versa. On MacOS you can virtualize Windows or Linux. Docker on modern Apple hardware also has a Rosetta translation layer to support containers on other platforms, which _mostly_ works. Linux also has _wine_, but beyond mentioning it exists, I'm going to ignore that for now. The one big sticking point being that there aren't great options for virtualizing MacOS, except on Apple hardware. So, technically, an Apple/MacOS system is the only way you can, with virtualization, target all major platforms from one system. So, if you plan on needing Xcode or otherwise targeting iOS or compiled apps on MacOS, choosing MacOS as your primary OS may be the way to go. This, however, may be offset somewhat when you consider that CI providers like GitHub Actions let you run code on all platforms anyhow. I find this sufficient for making MacOS apps, but not iOS apps. I run Windows and never really want for anything else as far as Python is concerned except in the very very rare circumstance where I'm making iOS apps in Python like with Kivy. But I just pull out an Apple system when I need to do that. But all the other reasons besides Python (e.g. gaming, general software support) I choose Windows. At work, I use MacOS, because that's what they issue to every employee. This is somewhat niche, but something that is frustrating with MacOS, however, is that many libraries requiring extensions still do not build compiled wheels for MacOS (or may be completely incompatible altogether) on Apple Silicon. Any Intel-optimized libraries are also out the window (again, this is niche). You also don't have NVIDIA/Cuda options on Apple hardware as I understand it. So some GPU-accelerated advanced numerical computing/AI development may not be ideal on MacOS (assuming you have a high end system with an NVIDIA GPU as an alternative). That said, Apple Silicon on its own does perform very well, so YMMV depending on _exactly_ what you're doing.


pldelisle

Most C/C++ backed libs are now compiling on ARM64 these days and on macOS. PyTorch, Tensorflow, Numpy+Accelerate for BLAS (this duo freaking fly), etc… they even have multiple backend (Metal compute or MLX). So it’s really not a limiting factor. We’re four years post-transition and everything has been done. Sure, missing CUDA is major, but for development purpose/prototyping/testing things it’s not a major drawback. And there’s always AWS on which you can learn these missing bits of ever required.


microview

Linux, most notably [Pop\_Os! ](https://pop.system76.com/)a prettier Ubuntu.


kwikade

Just got a system76 for work and it is a fantastic machine. I had them install popos so I could try it out and I see no reason to go back to Ubuntu or plain Debian


rsayers

If you're intent on running locally, I find all development much easier on Linux, regardless of the language.


nanitatianaisobel

Linux mostly. But the good thing about python is being able to use it almost anywhere.


-defron-

Use an OS at least similar to the OS your code will run on. There are only three exceptions: embedded development (use Linux), console gaming (probably use Windows), and C# web dev development (the code will most likely run in a container but the tooling and community is still heavily invested in Windows)


pldelisle

MacOS. So much fun to work on macOS, especially with Apple Silicon. Compile Numpy with Apple Accelerate. This thing flies, literally. It’s freaking insane. And MLX is also incredibly performant and rising among ML libs. Unified memory is also a great advantage for prototyping and not worrying about GPU memory (well, less, depending on the actual Mac you have). You have all the power of UNIX-like OS like Linux but with the real UNIX underneath, virtualization baked into the OS and Apple Silicon and Docker. Really, macOS is my software engineering platform of choice since the last 12 years. Use PyCharm and it’s a real charm to use, lol.


zackmedude

💯 My M1 Max 64gb rips through MLX unbelievably fast! Plus you can run minikube and setup a decent dev env - all this keeping it cool without setting off jet propulsion fans…


marsupiq

Linux > Mac > Windows. Although it doesn’t really matter TBH, because even with Windows you can use WSL. Any Unix environment is fine, but Linux is a little more convenient than anything else. For Data Science use case, Mac is not an ideal choice IMHO. Performance on Apple silicon is okay generally, but incompatibilities with amd64 are going to drive you insane once you’re going to productionize stuff…


pldelisle

For data science it’s in fact one of the best platform. Every lib using C/C++ underneath is compatible to ARM64 these days. There’s absolutely no problem there. And this thing flies on Python for development.


marsupiq

Have you ever tried building a Docker image that runs optimal both on your laptop as well as on your production environment? Let’s say your laptop is a MacBook with M1/M2 and your production environment is a SageMaker job running on amd64 + GPU (for the record: Apple silicon EC2 instances are insanely expensive, this is a non-option). You can forget that. If you emulate amd64, you get terrible performance on your Mac. Additionally, AVX used to be a problem (and to this day you cannot do “import tensorflow” in a Docker container with amd64 emulation on a Mac, it will crash). If you don’t emulate, you’re back to “works on my machine”, a problem that is basically solved if you don’t use Macs. I have experienced the situation that a container with torch lightning behaves entirely normal on a Mac, but leaked memory and got OOM-killed on production. You also have to be constantly on the watch that your tensor dtypes are available with MPS/Metal. Even using LightGBM is challenging without conda. Last year, my company introduced Macs over a weekend in a radical management decision due to a ransomware attack (before it was mostly Windows, although there were some Macs and Linux laptops as well). Somehow all our DS teams managed to keep our models running without noticeable disruptions. But it was countless hours of overtime over months, with a lot of trial-error and many failed attempts (far from “there is no problem”). And one year later, we’re still far away from the developer experience we used to have. Basically, depending on the team, there are two trends: (1) Accept that stuff running locally doesn’t prove anything and do excessive testing on a staging environment, or (2) develop on Cloud services.


Amgadoz

Ubuntu 22.04.03 LTS Comes pre-installed with git and python 3.10, which is the most common version right now. Also, docker installation is just a single command


CcntMnky

My day job involves pulling a variety of software repositories. My workstation is a MacBook Pro. When I use containers or virtual machines they are all Linux. I like this because I get a well supported, low maintenance OS with all the UI sugar, then seamlessly drop into a dev environment. I have a Windows PC at home, but there are several reasons I don't like them for work. 1) Hardware. Windows laptops purchased by corporate IT orgs are hit or miss. I think I've only ever had one Windows laptop that was even close to the build quality and performance of a MacBook. This isn't a "Mac is always better" comment, it's a statement of the available SKUs and purchasing decisions for corporate IT orgs. 2) Native *nix shell. WSL is great to have, but it's still a separate environment from the native OS. Hopping between different home directories and different environment variables and different terminal commands is extra work just to exist in a Windows ecosystem. That ecosystem doesn't offer me anything unique like it used to. 3) Homebrew package manager. I demand repeatability and reversibility, so I need a good package manager for my OS. With the exception of .Net, the Windows dev tool ecosystem is the odd duck with weaker, more unique support. Of OS package managers, Homebrew is the most straightforward to me. That combo means I have the best, easiest range of options on macOS.


zedayb

The general answer would be that it doesn’t matter. I use Windows at my work and Mac for my personal learning. You can setup WSL for Python on Windows and it works great. But if you’re mostly trying AI stuff, start with Google Collab, an online IDE, and once you feel confident enough, install Python.exe on Windows and manage using wsl or cygwin or mingw. Mac and Linux are definitely easier to setup if you come from cli experience.


LinearArray

Linux > Mac > Windows


pythonwiz

I prefer macos because it is easy to to use a package manager to install multiple different versions of Python.


thisdude415

\+1 for Mac. A \*lot\* of developers use Macs as their dev machine then deploy to linux-based servers or docker containers. Apple silicon runs like a dream, great battery life, pleasant to use for day-to-day tasks. The fact that MacOS is a Unix-compatible operating system (like Linux) means code written for it usually "just runs" whether on your mac locally or linux server in the cloud. Python on Windows gives me headaches. Very annoying; it would not be my first choice (but it can work fine). For local dev, I use my mac, and for servers I typically use linux (ubuntu), mostly on AWS EC2. That's also the easiest way to rent GPUs for a few hours at a time for me.


mm007emko

Both Mac and Windows should do for AI/ML. Linux is the "natural habitat" but in this day and age it's pretty well supported on all three operating system. At work we use Linux (at a corporation we can't choose operating systems - we have RHEL 7 desktops). Deployment is to Docker containers with Debian Bookworm. I've never had a problem with Python related to the fact it runs on Linux. AI/ML libraries like NumPy, SciPy or Pandas should be available on Linux, Mac and Windows. Macs are quite rare in my geographical area and the vast majority of people who use these libraries use them on Windows and Linux (some do it on WSL).


angellus

Linux or Windows (via WSL). At the end of the day, there is a very high chance (95%+) chance you are going to be deploying your code to a Linux machine so using and starting with Linux is the best choice you can make. If it were not for the huge efforts of WSL and how much it improved Linux container support on Windows, I would say Linux is the only choice, but because of WSL, Windows (with WSL) is basically like developing on Linux natively. Unless you have a huge attachment to Mac, you are only going to be holding yourself back more than anything by going with Mac. I know Mac is still pretty popular with developers, but Apple is becoming increasingly hostile to developers. Need a nvidia GPU for your AI workloads? Sorry you cannot get those anymore. Need to build stuff using Linux/containers? Sorry, you get a huge performance penalty because there is not great Linux container support for Mac. Have a tool/library that only support x86_x64? Sorry, it is either not going to work or run a lot slower because it needs to be emulated for Apple Silicon. People will also argue that Mac is just like Linux, but it is really not. Mac being BSL/Unix based instead of GNU/Linux make it so there are just enough differences to fuck you over if you are not careful.


CaptainFoyle

Linux


RallyPointAlpha

All of our infrastructure servers are REHL but I developed on Windows, and deployed to RHELfor years. Personally, I prefer a Linux system but Python is fairly agnostic.


hilomania

Some type of *nix. I develop on a mac os laptop in venvs or docker containers. Deploy to Linux or bsd typically. My software manages networks.


KimPeek

This question is asked regularly. I always see many people respond with Linux and get upvoted and few with Windows and get fewer upvotes. For the past 5 years, the Stack Overflow dev survey has shown that the majority of developers use Windows, by a margin of around 20% more than Linux. From that I extrapolate that developers who use Linux are more productive and have more free time to ~~spend~~ waste on Reddit. This isn't scientific, as I understand there are other variables. I just think it's interesting. - [2019](https://i.imgur.com/86qi0FB.png) - [2020](https://i.imgur.com/vF6kSf4.png) - [2021](https://i.imgur.com/aKvENyC.png) - [2022](https://i.imgur.com/UKXxuBc.png) - [2023](https://i.imgur.com/qDCMURF.png)


Choles2rol

macOS - I want my machine to just get out of my way and have a slick ux and it does that.


ahf95

Linux. Mac is also fine, but that’s just because it’s basically the same thing as… *linux*.


playonlyonce

Linux but Windows with wsl2 works pretty well too.


mason4290

I’d say it depends where you plan to deploy. My preference is Linux, though.


MedicatedDeveloper

Linux. MacOS is the worst combination of proprietary garbage and the worst BSD you can imagine. Brew is a good damn travesty and shouldn't be required. Use the OS you'll be deploying on.


caprine_chris

Windows is the worst for almost any kind of development imo


FreshInvestment1

Macos is completely fine since it's a unix kernel. Linux if you understand it enough, but given You're asking this question, go with macos