2

I'm new to Mac (as of yesterday), and I have Snow Leopard. I've just easy_install virtualenv, and it doesn't work. I read a couple other SO questions about the same exception I had, and it seems that I need XCode installed. Before I go down a rabbit hole, installing a 3.5Gb Apple-specific code library for something Python related, and who knows what else at this point, I figured I'd stop by here and find out what's typical for Django developers with Macs.

  1. What tools / libraries that are Python/Django specific, but non-project specific do you commonly use?
  2. Is XCode really necessary to use virtualenv (and potentially other things, or is this just one way to solve my issue?
  3. Are there other Mac issues that you've run into with basic Django development?
  4. Do you have any other tips for a veteran Django dev who is an absolute Mac noob?
orokusaki
  • 55,146
  • 59
  • 179
  • 257
  • Welcome to hell :) It's not an easy set up. – Ska Jul 05 '11 at 22:26
  • @Ska - it was actually pretty quick, minus downloading XCode, which was huge. It takes about 4 hours to get a new MacBook Pro from 0 to ready (including installing and configuring my editor (Komodo Edit), Firefox, etc), assuming you're OK with using the development server, and the testing DB (SQLite3) for Django development. I don't bother setting up a production-mirroring environment in OSX. Instead, I use VirtualBox with Ubuntu Lucid, and set things up there. No need to pretend a Mac is a server, just because it has a good shell. – orokusaki Jul 06 '11 at 14:53
  • I was referring to a mess that comes up if you use different Python versions, PIL setup, etc. I'll note a VirtualBox and Ubuntu Lucid, you use that with Vagrant? Thanks. – Ska Jul 06 '11 at 15:15
  • @Ska - I haven't tried Vagrant (looking up now though, thanks :) - btw, try out virtualenv, and virtualenvwrapper (easy to set-up, and work great) – orokusaki Jul 06 '11 at 15:17
  • I use both of those already, they are ok if you understand basic Python installs in Framework, installing of libs and problems with it. It's not straightforward, and this is a [very good post](http://stackoverflow.com/questions/3487664/getting-python-under-control-on-os-x-setting-up-environment-and-libraries/3489922) that I often refer to. – Ska Jul 06 '11 at 15:35

3 Answers3

9

You will need XCode, yes. You'll need it for any libraries that need compiling, apart from anything else.

Please don't install MacPorts, though, as recommended by titaniumdecoy. It tries to install its own versions of everything, which is unnecessarily confusing, and takes you out of the usual Mac development stack. A much better package installation tool is homebrew, which uses the built-in tools to install software via a series of recipes. It's excellent.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
4

I started use Mac a couple days ago and I have same problem. You need XCode, yes!

Packgers manager, like apt-get, you can try HomeBrew.

To develop in django, I use TextMate, with some bundles to django.

To develop in python I use pip, virtualenv and virtualenvwrapper, this is awesome.

Tarsis Azevedo
  • 1,463
  • 14
  • 21
  • thanks. BTW, checkout Komodo Edit for Mac. It's excellent (Command + Click to go to definitions, supports Django templates, etc). – orokusaki Feb 13 '11 at 16:51
  • I changed to VIM Editor again. TextMate it's good, but VIM its AWESOME. Add [some plugins](https://github.com/franciscosouza/vimfiles) and turn it perfect. – Tarsis Azevedo May 09 '11 at 13:52
1

As an iOS developer I can't comment on the specifics of Django development, but the following should help get you started.

Install macports immediately. You can install virtually any unix tool you can think of with a single command, including virtualenv. (Update: Use HomeBrew instead as suggested in other answers: see comments for why.)

You need to install Xcode to get the Mac OS X developer toolchain (gcc, etc.) unless you prefer to install everything yourself.

If you use Eclipse, the Pydev plug-in is one way to go. TextMate is probably the most popular text editor on the mac. The Python Wiki has a comprehensive rundown of your options.

titaniumdecoy
  • 18,900
  • 17
  • 96
  • 133
  • I seem to recall needing Xcode to build something from Macports (gtk maybe?) but I'm not positive it was absolutely necessary. It seemed to be, though, and that's what I did. (I wanted it anyway). – aptwebapps Feb 13 '11 at 07:49
  • I tried out Homebrew as suggested by others, and I am impressed. I am no longer using macports! – titaniumdecoy Feb 26 '11 at 01:04