]> granicus.if.org Git - esp-idf/commitdiff
tools/check_python_dependencies: make aware of IDF_TOOLS_PATH
authorIvan Grokhotkov <ivan@espressif.com>
Wed, 17 Apr 2019 07:32:03 +0000 (15:32 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Fri, 24 May 2019 09:04:23 +0000 (17:04 +0800)
tools/check_python_dependencies.py

index c04c4dbd8c7a43aae1c8681731fe930afc3d6c95..e2b58b29796dc3073efd6388b5abe6d3322c9fec 100755 (executable)
@@ -64,7 +64,15 @@ if __name__ == "__main__":
         print('The following Python requirements are not satisfied:')
         for requirement in not_satisfied:
             print(requirement)
-        if sys.platform == "win32" and os.environ.get("MSYSTEM", None) == "MINGW32" and "/mingw32/bin/python" in sys.executable:
+        if os.environ.get('IDF_PYTHON_ENV_PATH'):
+            # We are running inside a private virtual environment under IDF_TOOLS_PATH,
+            # ask the user to run install.bat again.
+            if sys.platform == "win32" and not os.environ.get("MSYSTEM"):
+                install_script = 'install.bat'
+            else:
+                install_script = 'install.sh'
+            print('To install the missing packages, please run "%s"' % os.path.join(idf_path, install_script))
+        elif sys.platform == "win32" and os.environ.get("MSYSTEM", None) == "MINGW32" and "/mingw32/bin/python" in sys.executable:
             print("The recommended way to install a packages is via \"pacman\". Please run \"pacman -Ss <package_name>\" for"
                   " searching the package database and if found then "
                   "\"pacman -S mingw-w64-i686-python{}-<package_name>\" for installing it.".format(sys.version_info[0],))