10 ms·
Slightly off-topic, but does anyone develop Django/Python on a windows machine, and may want to offer any general advice or tips? I am using virtualenv, but wo
by wtvanhest 10y ago
Slightly off-topic, but does anyone develop Django/Python on a windows machine, and may want to offer any general advice or tips?
I am using virtualenv, but wondering what else I should be doing to make it easier. Previously I used cloud9 (cloud IDE) for rails development. In both cases, I am pretty much a hobbiest, but don't mind spending some money to make things easier since I'd rather spend my time doing the fun part, rather than developer ops.
- throwawayish 10y agoYou probably want to use PyCharm. It's a great IDE, and pretty much just works. Personally I find the various CLI tools typically found on a BSD or Linux rather enticing for development, but many people do without that. Apart from that I'm not sure what you could mean / what your issues are. Specify?
- nkantar 10y agoMy two second-hand cents: At my previous company we used Vagrant for most projects, and it provided a nice abstraction layer that made things work reasonably well across all platforms (macOS, Windows, and Linux). Vagrant on Windows definitely had its challenges, though, but projects themselves ran well once that was sorted out. I've heard the company has since moved to Docker, in search of those same benefits but with smaller overhead (specifically in terms of time spent managing the abstraction layer), and I gather the Windows folks are happier with it than they ever were with Vagrant. My own (macOS-only) experience with both has been mixed, but certainly not worse than just running things locally via virtualenv. Vagrant introduces a full VM into the stack and Docker seems to have a lot of stability issues (at least on macOS 10.12 Sierra), so my next plan is to try combining the two, and running Docker on a Fedora VM. I'm hoping that any Docker nightmares will then at least be confined to the guest system, leaving my main machine mostly out of it, and using Docker to set up the actual project stuff may mean less Linux administration of the VM itself.
- throwawayish 10y agoPersonally I try to work as little with VMs as makes sense, they usually just make everything a bit harder and convoluted ("even" with Vagrant which, so far, has been a constant maintenance burden in all projects were I witnessed it's application, especially so if it's not only for Linux). My experiences with docker range from disastrous to annoying; I try to just not use it. It's not installed on any of my systems. If I have to use it, I do that in a VM. (I developed for some eight years on Windows, mostly C/C++, but last two years a lot of Python. At the time I wasn't aware of PyCharm, so Sublime Text "is also an editor" it was, but obviously just an editor; for development PyCharm is infinitely superior.)
- wtvanhest 10y agoHey, so I understand PyCharm is an editor, but what other functionality does it have that Sublime Text doesn't? I guess what I am asking is... what does everyone use for their DevOps stack (if that makes sense?) Right now I am using: CMD/bash vitualenv Sublime text Ruby Django I haven't installed a database yet, but was going to use Postgres. The way I understand Pycharm, I could use it to replace Sublime text and CMD/Bash right?
- toyg 10y agoDebugger, remote REPL, virtualenv and git integration and management, database interface (also for redis/mongo etc), unit test configurations and integrated runners, auto-linting, deployment tools and of course intelligent autocomplete... in the last EAP apparently they are introducing semantic coloring, which is going to be very fun.
- theptip 10y agoAll good points... just to add, PyCharm has a type hinting system (which informed the 3.5 Type Hints design), which knows the expected types for stdlib functions, and can be taught the types of user-defined function arguments. It'll then warn you if it thinks you are passing the wrong type of argument to a function. Obviously not infallible, but it catches time-wasters not infrequently.
- tehwalrus 10y agoI thought docker just ran a Linux VM if it wasn't already on Linux? I am going by what a colleague explained to me, so please correct me if I'm wrong!
- andy_ppp 10y agoYes, but the docker for mac uses 100% cpu per core if watching files. I think it's reasonable to assume using a better virtual machine (possibly including vmware and parallels, maybe virtualbox) means that file system events are less buggy.
- marcosscriven 10y agoThat's correct - it runs an xhyve VM on macOS
- AzMoo_ 10y agoWe give our windows users a Vagrantfile that runs a linux development environment they can ssh into.
- jdc 10y agoHave you tried PyCharm?
- ylem 10y agoHi! I develop early stages of Django apps on windows (it's probably bad practice, but I usually wait to test postgres until I am on a linux box--or if I am developing on a mac--we're oddly platform agnostic where I work). I have found Wing IDE to be incredibly productive (I've just started playing with PyCharm). I love Wing because of its debug options. You can debug templates as well as running processes....You can try Wing Professional for free to see if you like it. It's saved me a lot of time!!!
- eugenekolo2 10y agoWindows is fine for Python development. It's just an executable, and you can even use cmd.exe. Some will tell you for some good reasons, and others just cause they love to hate, to use cygwin or something. You can check out Windows 10 bash as well. If you find Windows some sort of hindrance, you can just use a Ubuntu VM, or reformat entirely to Ubuntu. I only use Ubuntu for over 2yrs now, and barely miss Windows, not much wrong with it though, esp. Windows10 w/ bash now.
- goodoldboys 10y agoI just switched from Mac to Windows 10, and I work on a lot of Django projects. I use PyCharm (love jetbrains) + Vagrant and it's working great so far. I'd highly recommend spending the time learning Vagrant - it can be incredibly frustrating at times (on both mac and windows), but once you get it working right it's really rewarding. Being able to re-instantiate a VM when something gets really botched is a great feeling. I don't have to worry about my host machine getting messed up, so I'm free to tinker around in the VM and that speeds up my learning. The one downside I've encountered so far is how many different "terminal" style apps I need to run to get everything working. Currently I need powershell (as admin) for spinning up the VM, putty to SSH into it, and git bash for source control. I can probably simplify them all into powershell but for now it works.
- my_ghola 10y agoYou can use ssh from git bash so there's no need for putty. And might want to look into Console2 or ConEmu both of which allow you to open multiple tabs for multiple shells.
- goodoldboys 10y agoYep, you're right. I just added git to my path so that I can now do it all from powershell, so that's cool!
- wtvanhest 10y agoI thought pycharm replaced git bash. I havent used pycharm yet, just thought that from reading about it.
- goodoldboys 10y agoI think you can use pycharm (and other jetbrains products) to handle version control, but I prefer to use a command line. It's what I'm used to.
- theptip 10y agoI recommend running an Ubuntu VM, with PyCharm as your IDE. There are so many little things that are more painful in Windows than in Linux. For example, getting psycopg2 running under Cygwin was an odyssey, whereas it's trivial to install on Linux. And there are plenty of Python packages that assume you have gcc and unix headers installed, which makes chasing dependencies painful.
- wtvanhest 10y agoJust out of curiousity, do you use something like this: http://www.psychocats.net/ubuntu/virtualbox http://www.psychocats.net/ubuntu/virtualbox ? Any other recommendations on how to install and start working with Ubuntu VM?
- theptip 10y agoWhen I was using Windows, I preferred VMWare Workstation [1]; the number of times that VirtualBox entered the "Guru Meditation" state and cost me a half-day of debugging was just too high to justify. If the price tag is too high, or you're just doing personal projects, I'd recommend VMWare Player [2] -- it's a free version with slightly fewer features. Last time I used it I think it didn't have snapshots, which can be useful in some cases, but aren't a deal-breaker. Having said that, a few colleagues used VirtualBox and found it to be OK; it seemed to stabilize a bit a year or two after I had problems with it (in 2015). [1]: http://www.vmware.com/products/workstation.html http://www.vmware.com/products/workstation.html [2]: http://www.vmware.com/products/player/playerpro-evaluation.html http://www.vmware.com/products/player/playerpro-evaluation.h...
- theptip 10y agoMissed your second question there -- I've always just installed Ubuntu from scratch on the VM guest. I've done that enough times that it doesn't feel like a lot of work to me. VirtualBox does have a nice feature that automates the installer, as well. I've never bothered with the whole Vagrant thing for personal dev machines, given the low cost of spinning up a new machine, it's not worth learning a new toolchain for me. But if I was spending more than a few hours every couple years on building new VMs, it would be worth it.