Install Python Imagin Library Mac

To install the latest version of python 2, simply type: $ brew install python If you'd rather install the latest version of python 3, replace python with python3. There are a few package managers that are specific to Python, and pip is the preferred one. Feb 21, 2014  pil 1.1.7 is included in anaconda distribution 1, very batteries-included, so make your life easy by installing anaconda 2 Personally, my life's way too short to manage crappy version conflicts between packages, across multiple platforms.

Micro Python supports OSX as well as it does Linux: once the necessary software dependencies are installed on an OSX system, development and usage is essentially the same on both platforms, so no special 'tricks' are required to work with Micro Python on OSX. May 01, 2013  Installing qtconsole for the new IPython 0.11 to work in Mac OS X is quite cumbersome. The following guide will help you in installing qtconsole for IPython on Mac OS X Lion. It will also work for newer versions of IPython.

Micro Python supports OSX as well as it does Linux: once the necessary software dependencies are installed on an OSX system, development and usage is essentially the same on both platforms, so no special 'tricks' are required to work with Micro Python on OSX. (If any discrepancies are found, they should be reported here or on the user forum.)

Windows Installation. If the prerequisites are installed in the standard library locations for your machine (e.g. /usr or /usr/local). Pkg install-y python ndk-sysroot clang make libjpeg-turbo. This has been tested within the Termux app on ChromeOS, on x86. Update: These instructions are over a year old, though they may still work for you. See the 'Install Python' page for the most up-to-date instructions. I've already written a post about installing Python, NumPy, SciPy, and matplotlib on Lion, but it involves a lot of working at the command line, modifying your.bashprofile and dealing with.

Specifically, this means that both the unix and stmhal (pyboard) ports of Micro Python can be compiled on Mac OSX directly from the master branch without any alteration. This article aims to describe which software packages are required to build Micro Python and how to install them on your OSX system. I use Macports so this article will focus on that; it is also possible to Homebrew to install the required software dependencies.

This article is targeted towards Micro Python developers using OSX, it will address OSX specific issues rather than general development questions.

Recent modifications to the build scripts have made the build process for the unix port on OSX the same as it is that on Linux, despite the fact that Micro Python is built using gcc on Linux and clang on OSX.In order to compile on OSX you will need the following software packages installed:

  • A relatively recent version of Xcode to provide the clang compiler (micropython has been confirmed to compile under clang versions 3.1 and 4.2)
  • Macports for the next commands
  • libffi (minimum version 3.1-4 from Macports) sudo port install libffi
  • pkgconfig sudo port install pkgconfig
  • Python >= 3.3 sudo port install python34
  • Setup python34 as python3 `sudo port select python3 python34'
  • git - to keep local source tree up to date sudo port install git
  • If you like using git completion or $(__git_ps1) for your prompt, then add the following line to your ~/.bashrc file: . /opt/local/share/git/contrib/completion/git-prompt.sh

Build Process

Install Python Imagin Library Mac

Same as on Linux

  • go to micropython/mpy-crossand run `make -C mpy-cross``
  • go to micropython/ports/unix and
    • run make axtls,
    • run make (or make -B or make clean; make if rebuilding.

Install Python Imagine Library Mac Os

If installing libffi with homebrew, you might have to specify its location to pkgconfig

Running tests

Go to micropython/tests and run the test script ./run-testsThe test script will look for the executable in ../unix/micropython and will compare the output of the micropython executable to the locally installed version of Python3

  • If your Python3 executable is named python3.x then it may be necessary to create a link named python3 to this executable
  • All tests should pass on OSX, however it may be necessary to set the encoding in the terminal to 'UTF-8' if the unicode tests are failing

Required software:

  • mac version of gcc-arm-none-eabi, version >= 4.8
  • dfu-util >= 0.7 to load firmware to pyboard
  • Python3 >= 3.3
  • pyserial package for Python3

TODO: building stmhal

TODO: Using test scripts to run tests on pyboard

Using pyboard.py to run python scripts residing on the mac:

Library

Using screen to access REPL

Type screen /dev/tty.usbmodem* with * replaced by your specific device number; use ls /dev/tty.usbmodem* to find the name of your device.To exit from 'screen' type 'Ctl-a, k'; and then answer 'y' to exit

Development workflow on mac is the same as for Linux; see DevelWorkflow for recommended workflow practices and usage of git.

TODO: Issues that may be encountered using previous versions of pyboard firmware (USB mass storage issue) that can be fixed with firmware upgrade

It turns out that there are some bugs in the OSX portion of pyserial 2.7. To confirm if your pyserial has been fixed or not, plug in your pyboard, and the run the following python script using python3 (just to be clear, this script will be run on your Mac, not on the pyboard)

If you get output like this:

Install Python Imagine Library Mac Download

Then your version of pyserial is working and you don't need to do anything further.

If, however, you get no output (no serial ports listed) when running python3 and get output similar to the above when running python2 then you have the buggy version.

I found this issue http://sourceforge.net/p/pyserial/patches/38/ with an attached patch which addresses the issue.

I installed python34 using ports (as in the first part of this wiki page) and my python 3.4 version of pyserial was found here: /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/serial

I executed the following commands to install the patched version:

Now I was able to execute the list_ports.comports() example posted above under python3 and it produced the correct output.