diff --git a/docs/en/get-started/macos-setup.rst b/docs/en/get-started/macos-setup.rst index 3317311843..571062d5b9 100644 --- a/docs/en/get-started/macos-setup.rst +++ b/docs/en/get-started/macos-setup.rst @@ -37,7 +37,7 @@ ESP-IDF will use the version of Python installed by default on macOS. Installing and setting up Python 3 as default --------------------------------------------- -Basing on macOS `Catalina 10.15 release notes`_, use of Python 2.7 is not recommended and Python will not be included by default in future versions of macOS. Check what Python you currently have:: +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:: python --version @@ -54,7 +54,7 @@ Below is an overview of steps to install Python 3 and making it default interpre brew install python3 ln -s /usr/local/bin/python3.8 /usr/local/bin/python - Adjust above directory name ``/usr/local/bin/python3.8`` to point where Python 3 has been installed. To check this directory you can run ``which -a python``. + Adjust above directory name ``/usr/local/bin/python3.8`` to point where Python 3 has been installed. To check this directory you can run ``which -a python3``. - If you have MacPorts_, you can run:: @@ -77,6 +77,7 @@ Python 2 deprecation Python 2 reached its `end of life `_ and support for it in ESP-IDF will be removed soon. Please install Python 3.6 or higher. Instructions for macOS are listed above. + Next Steps ========== diff --git a/docs/zh_CN/get-started/linux-setup-scratch.rst b/docs/zh_CN/get-started/linux-setup-scratch.rst index b95d17fd52..beecc67597 100644 --- a/docs/zh_CN/get-started/linux-setup-scratch.rst +++ b/docs/zh_CN/get-started/linux-setup-scratch.rst @@ -15,18 +15,21 @@ - CentOS 7:: - sudo yum install git wget ncurses-devel flex bison gperf python pyserial python-pyelftools cmake ninja-build ccache dfu-util + sudo yum -y update && sudo yum install git wget ncurses-devel flex bison gperf python3 python3-pip cmake ninja-build ccache dfu-util + +目前仍然支持 CentOS 7,但为了更好的用户体验,建议使用 CentOS 8。 - Ubuntu 和 Debian:: - sudo apt-get install git wget libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache libffi-dev libssl-dev dfu-util + sudo apt-get install git wget libncurses-dev flex bison gperf python3 python3-pip python3-setuptools python3-serial python3-cryptography python3-future python3-pyparsing python3-pyelftools cmake ninja-build ccache libffi-dev libssl-dev dfu-util - Arch:: - sudo pacman -S --needed gcc git make ncurses flex bison gperf python-pyserial python-cryptography python-future python-pyparsing python-pyelftools cmake ninja ccache dfu-util + sudo pacman -Sy --needed gcc git make ncurses flex bison gperf python-pyserial python-cryptography python-future python-pyparsing python-pyelftools cmake ninja ccache dfu-util .. 注解:: - 使用 ESP-IDF 需要 CMake 3.5 或以上版本。较早的 Linux 发行版可能需要升级自身的软件源仓库,或开启 backports 套件库,或安装 "cmake3" 软件包(而不是安装 "cmake")。 + + 使用 ESP-IDF 需要 CMake 3.5 或以上版本。较早的 Linux 发行版可能需要升级自身的软件源仓库,或开启 backports 套件库,或安装 "cmake3" 软件包(不是安装 "cmake")。 从源代码编译工具链 ================================= @@ -35,7 +38,7 @@ - CentOS 7:: - sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool make + sudo yum install gawk gperf grep gettext ncurses-devel python3 python3-devel automake bison flex texinfo help2man libtool make - Ubuntu pre-16.04:: @@ -51,7 +54,7 @@ - Arch:: - TODO + sudo pacman -Sy --needed python-pip 创建工作目录,并进入该目录:: @@ -97,7 +100,14 @@ 注意这里的 ``/home/user-name`` 应该替换成您安装的主路径。 + +停用 Python 2 +==================== + +Python 2 已经 `结束生命周期 `_,ESP-IDF 很快将不再支持 Python 2。请安装 Python 3.6 或以上版本。可参考上面列出的目前主流 Linux 发行版的安装说明。 + + 后续步骤 ========== -请前往 :ref:`get-started-get-esp-idf` 章节继续设置开发环境。 \ No newline at end of file +请前往 :ref:`get-started-get-esp-idf` 章节继续设置开发环境。 diff --git a/docs/zh_CN/get-started/linux-setup.rst b/docs/zh_CN/get-started/linux-setup.rst index 3008149815..95ec5015b1 100644 --- a/docs/zh_CN/get-started/linux-setup.rst +++ b/docs/zh_CN/get-started/linux-setup.rst @@ -11,11 +11,13 @@ Linux 平台工具链的标准设置 - CentOS 7:: - sudo yum install git wget flex bison gperf python cmake ninja-build ccache dfu-util + sudo yum -y update && sudo yum install git wget flex bison gperf python3 cmake ninja-build ccache dfu-util + +目前仍然支持 CentOS 7,但为了更好的用户体验,建议使用 CentOS 8。 - Ubuntu 和 Debian:: - sudo apt-get install git wget flex bison gperf python python-pip python-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util + sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util - Arch:: @@ -32,20 +34,47 @@ Linux 平台工具链的标准设置 使用某些 Linux 版本向 {IDF_TARGET_NAME} 烧录固件时,可能会出现 ``Failed to open port /dev/ttyUSB0`` 错误消息。此时可以将用户添加至 :ref:`Linux Dialout 组`。 +设置 Python 3 为 CentOS 默认 Python 版本 +---------------------------------------------------- + +CentOS 7 及更早的版本提供 Python 2.7 作为默认解释器。但这里推荐使用 Python 3,您可以运行下方命令安装 Python 3。或者查看当前所用系统的相关文档,按照文档推荐的其它方法安装 Python 3:: + + sudo yum -y update && sudo yum install python3 python3-pip python3-setuptools + +设置 Python 3 为默认 Python 版本:: + + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && alias pip=pip3 + + 设置 Python 3 为 Ubuntu 和 Debian 默认 Python 版本 ---------------------------------------------------- -Ubuntu v20.04 和 Debian v7 之前的版本默认解释器为 Python 2.7,但这里推荐使用 Python 3,您可以运行下方命令安装 Python 3。或者查看当前所用系统的相关文档,按照文档推荐的其它方法安装 Python 3:: +Ubuntu(v18.04 及之前的版本)和 Debian(v9 及之前的版本)的默认解释器为 Python 2.7,但这里推荐使用 Python 3,您可以运行下方命令安装 Python 3。或者查看当前所用系统的相关文档,按照文档推荐的其它方法安装 Python 3:: sudo apt-get install python3 python3-pip python3-setuptools 设置 Python 3 为默认 Python 版本:: - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && alias pip=pip3 .. 注解:: 上述设置为全局设置,同时会影响到其它应用。 + +修复 Ubuntu 16.04 损坏的 pip +================================= + +``python3-pip`` 包可能已损坏无法升级。需使用脚本 `get-pip.py `_ 手动删除并安装该包:: + + apt remove python3-pip python3-virtualenv; rm -r ~/.local + rm -r ~/.espressif/python_env && python get-pip.py + +停用 Python 2 +==================== + +Python 2 已经 `结束生命周期 `_,ESP-IDF 很快将不再支持 Python 2。请安装 Python 3.6 或以上版本。可参考上面列出的目前主流 Linux 发行版的安装说明。 + + 后续步骤 ========== diff --git a/docs/zh_CN/get-started/macos-setup-scratch.rst b/docs/zh_CN/get-started/macos-setup-scratch.rst index 19067b44d7..6023501b61 100644 --- a/docs/zh_CN/get-started/macos-setup-scratch.rst +++ b/docs/zh_CN/get-started/macos-setup-scratch.rst @@ -1,5 +1,5 @@ *********************************************** -从零开始设置 MacOS 环境下的工具链 +从零开始设置 macOS 环境下的工具链 *********************************************** :link_to_translation:`en:[English]` @@ -80,6 +80,12 @@ MacPorts 需要完整的 XCode 软件,而 Homebrew 只需要安装 XCode 命 编译得到的工具链会被保存到 ``~/esp/ctng-volume/crosstool-NG/builds/xtensa-{IDF_TARGET_TOOLCHAIN_NAME}-elf``。使用工具链前,请将 ``~/esp/ctng-volume/crosstool-NG/builds/xtensa-{IDF_TARGET_TOOLCHAIN_NAME}-elf/bin`` 添加至 ``PATH`` 环境变量。 +停用 Python 2 +==================== + +Python 2 已经 `结束生命周期 `_,ESP-IDF 很快将不再支持 Python 2。请安装 Python 3.6 或以上版本。可参考上面列出的 macOS 安装说明。 + + 后续步骤 ========== diff --git a/docs/zh_CN/get-started/macos-setup.rst b/docs/zh_CN/get-started/macos-setup.rst index 16f92fb1d3..b15e5e3e91 100644 --- a/docs/zh_CN/get-started/macos-setup.rst +++ b/docs/zh_CN/get-started/macos-setup.rst @@ -38,7 +38,7 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。 安装并设置 Python 3 为默认版本 --------------------------------------------- -`Catalina 10.15 发布说明`_ 中表示不推荐使用 Python 2.7 版本,在未来的 macOS 版本中也不会默认包含 Python。执行以下命令来检查您当前使用的 Python 版本:: +`Catalina 10.15 发布说明`_ 中表示不推荐使用 Python 2.7 版本,在未来的 macOS 版本中也不会默认包含 Python 2.7。执行以下命令来检查您当前使用的 Python 版本:: python --version @@ -55,7 +55,7 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。 brew install python3 ln -s /usr/local/bin/python3.8 /usr/local/bin/python - 将上述的目录名 ``/usr/local/bin/python3.8`` 修改为 Python 3 所在的目录。您可以运行 ``which -a python`` 来查看 Python 3 所在的目录。 + 将上述的目录名 ``/usr/local/bin/python3.8`` 修改为 Python 3 所在的目录。您可以运行 ``which -a python3`` 来查看 Python 3 所在的目录。 - 使用 MacPorts_ 进行安装的方法如下:: @@ -73,6 +73,13 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。 上述设置为全局设置,同时会影响到其它应用。 + +停用 Python 2 +==================== + +Python 2 已经 `结束生命周期 `_,ESP-IDF 很快将不再支持 Python 2。请安装 Python 3.6 或以上版本。可参考上面列出的 macOS 安装说明。 + + 后续步骤 ========== @@ -84,4 +91,5 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。 .. _ccache: https://ccache.samba.org/ .. _homebrew: https://brew.sh/ .. _MacPorts: https://www.macports.org/install.php -.. _Catalina 10.15 发布说明: https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes \ No newline at end of file +.. _Catalina 10.15 发布说明: https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes +