]> granicus.if.org Git - esp-idf/commitdiff
Encourage to install python packages without administrative rights
authorRoland Dobai <dobai.roland@gmail.com>
Fri, 7 Sep 2018 07:14:05 +0000 (09:14 +0200)
committerRoland Dobai <dobai.roland@gmail.com>
Tue, 11 Sep 2018 06:54:37 +0000 (08:54 +0200)
Using 'sudo pip install' can cause a lot of problems because usually
there are a couple of Python interpreters installed. This fix encourages
developers to use `pip install --user` instead which is safer.

docs/en/contribute/documenting-code.rst
docs/en/get-started-cmake/macos-setup-scratch.rst
docs/en/get-started-cmake/macos-setup.rst
docs/en/get-started-cmake/windows-setup-scratch.rst
docs/en/get-started/index.rst
docs/requirements.txt
docs/zh_CN/get-started/index.rst
tools/check_python_dependencies.py
tools/tiny-test-fw/docs/index.rst

index fd7d93866cdeb664bda6e9133d0797165f3bb691..bcbe66eafa8cf11e78fd38cb4ef54957899bb9fe 100644 (file)
@@ -298,7 +298,7 @@ All remaining applications are `Python <https://www.python.org/>`_ packages and
 ::
 
        cd ~/esp/esp-idf/docs
-       pip install -r requirements.txt
+       pip install --user -r requirements.txt
 
 .. note::
 
index ae6e8c43ed560f3f4bede0eb816e9f3ae7c4a5ea..d75a1a8bb1b69a183c7219be510c817aa5c6e213 100644 (file)
@@ -23,7 +23,7 @@ Install Prerequisites
 
 - install pyserial::
 
-    sudo pip install pyserial
+    pip install --user pyserial
 
 - install CMake & Ninja build:
 
index 21a780c526a76e557a63f0b9fad0ef95623dc443..6a4241f4f3c8a8548a8f5a81d9e52ccc839dba65 100644 (file)
@@ -15,7 +15,7 @@ ESP-IDF will use the version of Python installed by default on Mac OS.
 
 - install pyserial::
 
-    sudo pip install pyserial
+    pip install --user pyserial
 
 - install CMake & Ninja build:
 
index d8381ae686e71bd7604bcb2691102329d74edf2e..58c6af9e222a9af148fc936d48e304c4b9a19e36 100644 (file)
@@ -42,7 +42,7 @@ The "Customise" step of the Python installer gives a list of options. The last o
 
 Once Python is installed, open a Windows Command Prompt from the Start menu and run the following command::
 
-  pip install pyserial
+  pip install --user pyserial
 
 MConf for IDF
 ^^^^^^^^^^^^^
index c558dbf38a2ec3ae9026451ddfbdd52a6995b8a3..1d14de4df05d21fbd29f99bcfde8288ecf62024e 100644 (file)
@@ -143,10 +143,6 @@ Install the Required Python Packages
 \r
 Python packages required by ESP-IDF are located in the ``$IDF_PATH/requirements.txt`` file. You can install them by running::\r
 \r
-    sudo python -m pip install -r $IDF_PATH/requirements.txt\r
-\r
-or you can use the following command for installing them into the user install directory on systems where you don't have administrator rights::\r
-\r
     python -m pip install --user -r $IDF_PATH/requirements.txt\r
 \r
 .. note::\r
@@ -155,7 +151,7 @@ or you can use the following command for installing them into the user install d
     interpreter can be checked by running command ``python --version`` and depending on the result, you might want to\r
     use ``python2``, ``python2.7`` or similar instead of ``python``, e.g.::\r
 \r
-        sudo python2.7 -m pip install -r $IDF_PATH/requirements.txt\r
+        python2.7 -m pip install --user -r $IDF_PATH/requirements.txt\r
 \r
 .. _get-started-start-project:\r
 \r
index dfd6f5c08a445ed9612033fcc874ba482f36faf8..6a4de8f3f6ee0a582745d556ea207f2c9cc92294 100644 (file)
@@ -1,5 +1,5 @@
 # This is a list of python packages used to generate documentation. This file is used with pip:
-# pip install -r requirements.txt
+# pip install --user -r requirements.txt
 #
 sphinx==1.6.5
 sphinx-rtd-theme
index 11ff33a8f670e150d89d822fe083b8871a61326e..7ec10482c4bdec98a712379a74d1cab16baf2896 100644 (file)
@@ -142,12 +142,6 @@ ESP32 是一套 Wi-Fi (2.4 GHz) 和蓝牙 (4.2) 双模解决方案,集成了
 
 ESP-IDF 所依赖的 Python 软件包位于 ``$IDF_PATH/requirements.txt`` 文件中,您可以通过运行以下命令来安装它们:
 
-.. code:: bash
-
-    sudo python -m pip install -r $IDF_PATH/requirements.txt
-
-如果您没有系统的管理员权限,那么可以使用如下命令来将软件包安装到用户目录中:
-
 .. code:: bash
 
     python -m pip install --user -r $IDF_PATH/requirements.txt
@@ -156,7 +150,7 @@ ESP-IDF 所依赖的 Python 软件包位于 ``$IDF_PATH/requirements.txt`` 文
 
     请调用 ESP-IDF 使用的相同版本的 Python 解释器,解释器的版本号可以通过运行命令 ``python --version`` 来获得,根据结果,您可能要使用 ``python2``, ``python2.7`` 或者类似的名字而不是 ``python``,例如::
 
-        sudo python2.7 -m pip install -r $IDF_PATH/requirements.txt
+        python2.7 -m pip install --user -r $IDF_PATH/requirements.txt
 
 .. _get-started-start-project:
 
index 30eaffc0218c528fcc741d03b50b863cba83a577..4f03d0650d50f9b989d3d671a1ebf9a634c7df83 100755 (executable)
@@ -47,7 +47,7 @@ if __name__ == "__main__":
         print('The following Python requirements are not satisfied:')
         for requirement in not_satisfied:
             print(requirement)
-        print('Please run "{} -m pip install -r {}" for resolving the issue.'.format(sys.executable, args.requirements))
+        print('Please run "{} -m pip install --user -r {}" for resolving the issue.'.format(sys.executable, args.requirements))
         sys.exit(1)
 
     print('Python requirements from {} are satisfied.'.format(args.requirements))
index 76bd236d07507e4638416763bb756a0fe4c67608..af5115a92c7e3d3bc898e65da5b5b301f7f418b1 100644 (file)
@@ -190,7 +190,7 @@ The following 3rd party lib is required:
     * netifaces
     * matplotlib (if use Utility.LineChart)
 
-These libraries can be installed by running ``pip install -r requirements.txt`` in tiny-test-fw directory.
+These libraries can be installed by running ``pip install --user -r requirements.txt`` in tiny-test-fw directory.
 
 To build document, we need to install ``Sphinx``, ``plantweb`` and ``sphinx-rtd-theme`` (you may replace this with your own theme). ``plantweb`` requires internet access during building document.