Getting Going with Python on Mac OS X The aim of this web page is to help you get started with Python on Mac OS X. We will explain what a package management tool is, how to download conda package management tool via the Anaconda installer, and guide you on the OS X Terminal application so that you can use conda from the command line.
Finally, we will wrap up by installing one library with conda. What Is a Package Management Tool? A package management tool is a software application that helps you manage software libraries that enable you to get your work done. These software libraries may relate to plotting for scientific publication or accessing certain kinds of data, for example. When you start using Python, you will want use software libraries that are not part of the standard Python installation. For example, you may wish to use the for meteorological data and visualization.
OS X 10.10 (Yosemite) or OS X 10.11 (El Capitan) Install. Download Scipy Superpack Installer for OSX 10.10. To install, open a terminal in the directory that the script is located and call: sh install_superpack.sh. If you have not already installed the current Homebrew, Git, and the Xcode command line tools, these will be installed for you.
Anaconda from Continuum Analytics will help you install metpy easily. Installing the conda Package Management Tool The conda package management tool is part of the Anaconda software package. Install conda by navigating to the.
Scroll down to the “Anaconda for OS X” portion of the web page. Download the Python 3.5 version by clicking on the “Mac OS X 64 bit Graphical Installer” link. It is a big download, so it is best to be on fast network. Open the installer file you just downloaded. It should be named something like Anacondaversion-MacOSX-x8664.pkg. This action will guide you through the. The second “Read Me” step is important, as the installation will make some modifications that the OS X Terminal application can make use of.
We cover the OS X Terminal next. OS X Terminal Application The OS X Terminal is a software program that gives you the ability to give text based instructions to your computer.
As you make progress in geoscientific programming, you will probably use the Terminal a lot, so it will benefit you to become familiar with it. For this exercise we will open up the Terminal by going to the OS X Finder and navigating to the Application, Utilities folder. There you will find the Terminal application which you can double click on to launch. In the Terminal application, you will see a character such as $ symbol known as the command line. The command line is where you give text instructions to your computer.
![Download free mac os x Download free mac os x](/uploads/1/2/5/6/125614828/166750313.jpg)
Interacting with conda Let’s make sure conda is installed by entering this instruction on the command line. # packages in environment at /Users/chastang/anaconda: # alabaster 0.7.7 py350 anaconda 4.0.0 np110py350 anaconda-client 1.4.0 py350. Numexpr 2.5 np110py350 numpy 1.10.4 py350 odo 0.4.2 py350. Yaml 0.1.6 0 zeromq 4.1.3 0 zlib 1.2.8 0 which will list linked packages in a conda environment. You’ll notice libraries such as the scientific computing library that you will probably be making use of.
If You Have Problems with conda list If conda list worked without trouble, skip this subsection. If that last conda list command gave you an error, it is possible that you are running the wrong flavor of the OS X Terminal (or more precisely the wrong Unix shell).
Ensure you are running the bash shell by going to Terminal, Preferences menu, and verifying that /bin/bash is selected. If you change it, please quit, and restart the Terminal application. Getting Our Feet Wet by Installing Metpy with conda We first have to give conda an instruction on where to find metpy on the conda-forge channel.
After doing some digging around, installing and using MatplotLib on the Mac can be done easily. First, you'll need to download four dmg files: Python 2.6.5 Numpy (must be version 1.1 or later) Scipy And finally, matplotlib Install python first. Then install numpy and scipy.
Lastly, install matplotlib. These are all dmg’s so they should automatically install everything and set up any environment variables needed. Once everything is installed, create a new python script, cut and paste one of their examples into it, then try to run it. Here is the one I used: from mpltoolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure ax = Axes3D(fig) for c, z in zip('r', 'g', 'b', 'y', 30, 20, 10, 0): xs = np.arange(20) ys = np.random.rand(20) ax.bar(xs, ys, zs=z, zdir='y', color=c, alpha=0.8) ax.setxlabel('X') ax.setylabel('Y') ax.setzlabel('Z') plt.show This should display a 3D bar graph using transparency and multiple colors. So far, only one person reported a problem with this. It turns out that their.bashprofile file was not being called (python sets up it's path setting there). If matplotlib does not run after installing, open a terminal and check the version of python by typing python -V.
If the version is 2.5, then your.bashprofile may not be getting called OR you are somehow altering the PATH environment variable to overwrite the python settings. If that is the case, you'll need to add the python path to your PATH environment variable.
The python path should be FIRST in your PATH variable. After that is set, source your file or open a new terminal. The python version should now be 2.6.5. Matplotlib should work after that.