Make sure you get the most recent version that is explicitly for Mac OS 10.6-10.7+. Install Python. Go to the Python download page and download the package called Python 2.7.2 Mac OS X 64-bit/32-bit x86-64/i386 Installer. Double-click the downloaded.dmg file to install Python. Install NumPy. This page provides the instructions for how to install and run IPython and Jupyter Notebook in a virtualenv on Mac. Most probably your Mac has already come with Python installed (see step 1 and step 2 below to check whether Python and Python 3 is installed on your mac, because my Mac book air has both Python and Python3.6 installed, I will go ahead to step 3 to install virtualenv). Pandas是以NumPy和Matplotlib为基础封装的金融数据分析的库,对于量化交易十分有用,通过可视化的效果能帮我们一定程度分析股市的走向。 Python3若没有pip安装numpy时会报错. In Mac terminal (we can launch Mac Terminal by searching in spotlight search Command + space) Now, use the command: pip3 install pandas. As I'm using Python Version 3 I need to use pip3 install pandas. If you are using python version 2 than use Command: pip install pandas. Make sure pip is already installed. Jan 10, 2019 How to install PIP on Mac. When it comes to installing PIP on Mac then many modern Macs comes preloaded with Python and PIP. But actually, that version of Python is a bit outdated, keeping in mind the serious Python development. So we advise you to install the current version of Python for maximum output.
Overview
Nov 09, 2019 Install it and find out where it puts the Python executable (python.exe in Windows and python3 or python in Linux and Mac). For example in Windows the full path is by default c:anacondapython.exe.
Python packages are typically installed from one of two package repositories:
PyPI; or
Any Python package you install from PyPI or Conda can be used from R with reticulate.
Each version of Python on your system has its own set of packages and reticulate will automatically find a version of Python that contains the first package that you import from R. If need be you can also configure reticulate to use a specific version of Python.
Python environments
When installing Python packages it’s typically a good practice to isolate them within a Python environment (a named Python installation that exists for a specific project or purpose). This provides a measure of isolation, so that updating a Python package for one project doesn’t impact other projects.
The reticulate package includes functions for creating Python environments (either virtualenvs or conda envs) and installing packages within them. Using virtualenvs is supported on Linux and Mac OS X, using Conda environments is supported on all platforms including Windows.
With pip-GUI
From the 'Tools' menu select 'Manage packages...' and follow the instructions.
With pip on command line
- From the 'Tools' menu select 'Open system shell...'. You should get a new terminal window stating the correct name of the pip command (usually
pip
orpip3
). In the following I've assumed the command name ispip
. - Enter
pip install <package name>
(eg.pip install pygame
) and press ENTER. You should see pip downloading and installing the package and printing a success message. - Close the terminal (optional)
- Return to Thonny
- Reset the interpreter by selecting 'Stop/Reset' from the 'Run menu' (this is only required the first time you do the pip install)
- Start using the package
Using scientific Python packages
The Python distribution that comes with Thonny doesn't contain scientific programming libraries (e.g. NumPy and Matplotlib).
Recent versions of most popular scientific Python packages (eg. numpy, pandas and matplotlib) have wheels available for popular platforms so you can most likely install them with pip but in case you have trouble, you could try using Thonny with a separate Python distribution meant for scientific computing (eg. Anaconda, Canopy or Pyzo).
Example: Using Anaconda
Go to https://www.continuum.io/downloads and download a suitable binary distribution for your platform. Most likely you want the graphical installer and the 64-bit version (you may need a 32-bit version if you have a very old system). Note that Thonny supports only Python 3, so make sure you choose a Python 3 version of Anaconda.
Install it and find out where it puts the Python executable (python.exe in Windows and python3 or python in Linux and Mac). For example in Windows the full path is by default c:anacondapython.exe
.
Install Pandas Library Windows
In Thonny, open the 'Tools' menu and select 'Options...'. In the options dialog, open the 'Intepreter' tab, click 'Select executable' and show the location of Anaconda's Python executable.
Python Install Pandas Mac
After you have done this, the next time you run your program, it will be run through Anaconda's Python and all the libraries installed there will be available.