1

I know this may be a repeat question, but all the answers I've found on here are WAY above my head. I'm very new at Python, but I would like to use NumPy in IDLE (python 3.3.2). IDLE doesn't seem to access the numpy that comes w/ OSX 10.8 (which is python 2.7). I can't find a Numpy for Python 3 installer for Mac OSX. All of the instructions I've found are very complicated and assume I know a lot more than I do and they still wouldn't help me get it into IDLE even if I could execute them. Can anyone point me to instructions for BEGINNERS on this installation? For example, most start with a compiling step - I'm not sure how to do this. I'd appreciate any help you can give. Thanks.

Kim Delaney
  • 37
  • 2
  • 6

2 Answers2

3

If this is a fresh python install:

  1. Type which python into a terminal window to make sure that the correct python is selected. I am guessing that this should be /Library/Frameworks/Python.framework/Versions/3.3.
  2. Download setuptools and pip from https://pypi.python.org and untar both (can just double click in a osx window).
  3. In a terminal change directory to the downloaded setuptools folder: cd ~/Downloads/setuptools-x.x.x
  4. Type python setup.py install.
  5. Repeat 3 & 4 for pip.
  6. Now you can type pip install numpy and it will download and install numpy for you.

You might want to install everything through a single executable package. A free example can be found here (Anaconda), this includes the entire scipy suite and some extras. You will likely not need the majority of these, but it does include numpy and scipy in a very convenient package.

Daniel
  • 19,179
  • 7
  • 60
  • 74
  • When I type `which python` into the IDLE window it returns `SyntaxError: invalid syntax` However, the help menu and window title of IDLE both indicate Python 3.3.2. I get the same error when I enter `cd~/Documents/setuptools-0.9.7` (I moved the setuptools folder out of the downloads, I hope that's ok). – Kim Delaney Jul 23 '13 at 22:39
  • 1
    Terminal is not the same thing as the python IDLE. Terminal is a separate application and can be found in `/Applications/Utilities` and is used for the bash shell. Its fine if you move the setuptools folder as long as you know where it is :). Also, be careful there needs to be a space between `cd` and `~/Documents..`. – Daniel Jul 23 '13 at 23:15
  • I was under the impression that each Python build requires its own NumPy install. For example, the Python that runs in Terminal is Python 2.7.5, but IDLE is running 3.3.2 (and this is where I would like to use NumPy if possible). Within IDLE was finally able to change the directory using the `os` module, but `python setup.py install` still gives a SyntaxError. – Kim Delaney Jul 24 '13 at 13:19
  • Terminal will access the python version that is first in your `PATH`. This is why I need you to run `which python` to determine that the correct python is found. If you installed 3.3 using the downloadable executable before the previous python this will be the case. None of the above commands will work in the IDLE, they must be done in a terminal window. Again, I highly recommend downloading anaconda. – Daniel Jul 24 '13 at 13:30
  • If Terminal `python` command runs python 2.7.5 then you will have to do something like `/Library/Frameworks/Python.framework/Versions/3.3/bin/python setup.py install` in the terminal to access the correct python. Pip will be in the same bin folder after you install it. You will have to locate where python 3.3 is on your own, but it should be there. I find it strange that the default `python` isnt 3.3 if you did a normal install, it usually appends your path in your `~./bash_profile`. – Daniel Jul 24 '13 at 13:48
  • I finally figured it out! I was able to install setuptools and pip. Also, I installed anaconda (which I've had from the beginning but wasn't using correctly). I created a new Anaconda environment for Python3 and I can launch IDLE from within that environment. Thanks again for all the help. You really helped me understand how all this is structured. – Kim Delaney Jul 24 '13 at 15:08
0

These should be simple enough instructions for you http://docs.python.org/3/using/mac.html

Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188