As of this writing, you can install everything from Python 2.4 to Python 3.1.īy the way, perhaps you are savvy enough to know that your Mac already comes with Python (and Perl and Ruby and PHP and goodness knows what else) already installed. If you type in:Ī whole lot of stuff is going to fly by, but you can scroll to the middle of the list to see all the versions of Python that are available for you to install. MacPorts gives you some nice functionality with its `search` feature, which you can use to find MacPort portfiles. How did I know to type in `python27` and not just `python`? Good question. Good for you for having quiet confidence in your Mac.) (If you’d rather not see all that and having the machine quietly do its thing, you can leave the `-v` off. Be prepared to watch a lot of stuff scroll by. The `-v` option gives you a verbose description of what’s happening. In my case, I am building a setup around Python 2.7, and so I entered `sudo port -v install python27`. Now you’ll need to install a version of Python. # Use MacPorts to Install Python and the Libraries You Need for NLTK You know, just to make yourself feel better. MacPorts should, as part of the install process, run `sudo port selfupdate -v` but you can always run it again. Until this gets cleared up, my best recommendation is to install Xcode the usual way, and then to proceed as MacPorts directs you to.ĭownload the () and step through the GUI install. (Again, I don’t know why that is.)Īs I note in an updated version of this, there is now supposed to be a shortcut from the command line to install what you need, but I have had various results and I have received reports of others having the same, various, results.
I’m not entirely clear what there is in Xcode or what Xcode installs that is needed for package managers like MacPorts, but MacPorts requires it, so go do it … by the way, I think the new way this happens is that the App Store will install an application that you will find in the Applications folder and that you have to click on to install Xcode.
Use MacPorts to install all the Python libraries you need, including NLTK.īefore you do anything else, you will need to open the and download Xcode, Apple’s Developer’s Suite for creating OS X applications. Install Xcode (and then the Xcode development tools).ģ.
Here are the steps that we are going to take to get NLTK up and running on Mac OS X:ġ. More importantly, you are doing it for yourself. The first few steps are a bit more complex, but I think you will be gratified pretty quickly with how much you can do and how quickly you are doing it. First of all, congratulations for wanting to go the building-block route as opposed to the already assembled route. So somehow, somewhere, you got interested in natural language processing, and the Natural Language Toolkit available for Python strikes you as one reasonable place to start. *Please note that there is a more direct version of these instructions that walks you through setting up everything around a Python 2.7 installation: read it ().*