macos-setup.rst 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. **********************************************
  2. Standard Setup of Toolchain for Mac OS
  3. **********************************************
  4. :link_to_translation:`zh_CN:[中文]`
  5. Install Prerequisites
  6. =====================
  7. ESP-IDF will use the version of Python installed by default on macOS.
  8. - install pip::
  9. sudo easy_install pip
  10. - install CMake & Ninja build:
  11. - If you have HomeBrew_, you can run::
  12. brew install cmake ninja dfu-util
  13. - If you have MacPorts_, you can run::
  14. sudo port install cmake ninja dfu-util
  15. - Otherwise, consult the CMake_ and Ninja_ home pages for macOS installation downloads.
  16. - It is strongly recommended to also install ccache_ for faster builds. If you have HomeBrew_, this can be done via ``brew install ccache`` or ``sudo port install ccache`` on MacPorts_.
  17. .. note::
  18. If an error like this is shown during any step::
  19. xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  20. Then you will need to install the XCode command line tools to continue. You can install these by running ``xcode-select --install``.
  21. Installing Python 3
  22. -------------------
  23. Basing on macOS `Catalina 10.15 release notes`_, use of Python 2.7 is not recommended and Python 2.7 will not be included by default in future versions of macOS. Check what Python you currently have::
  24. python --version
  25. If the output is like ``Python 2.7.17``, your default interpreter is Python 2.7. If so, also check if Python 3 isn't already installed on your computer::
  26. python3 --version
  27. If above command returns an error, it means Python 3 is not installed.
  28. Below is an overview of steps to install Python 3.
  29. - Installing with HomeBrew_ can be done as follows::
  30. brew install python3
  31. - If you have MacPorts_, you can run::
  32. sudo port install python38
  33. Python 2 deprecation
  34. ====================
  35. Python 2 reached its `end of life <https://www.python.org/doc/sunset-python-2/>`_ and support for it in ESP-IDF will be removed soon. Please install Python 3.6 or higher. Instructions for macOS are listed above.
  36. Next Steps
  37. ==========
  38. To carry on with development environment setup, proceed to :ref:`get-started-get-esp-idf`.
  39. .. _cmake: https://cmake.org/
  40. .. _ninja: https://ninja-build.org/
  41. .. _ccache: https://ccache.samba.org/
  42. .. _homebrew: https://brew.sh/
  43. .. _MacPorts: https://www.macports.org/install.php
  44. .. _Catalina 10.15 release notes: https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes