diff options
| author | Damien George <damien@micropython.org> | 2021-12-21 23:16:51 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-12-29 23:55:37 +1100 |
| commit | 959e6f7da91a8b751084c33a6ed0db807f72b0b9 (patch) | |
| tree | 3bbecc972ac4d7865d3313f821e4ddb6d6cc2597 | |
| parent | aac5a97d08f9f28b7c3f170d007be0b538349937 (diff) | |
tools/upip.py: Skip '.frozen' entry in sys.path for install path.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | tools/upip.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/upip.py b/tools/upip.py index a6d4c93ae..9fb872642 100644 --- a/tools/upip.py +++ b/tools/upip.py @@ -262,6 +262,8 @@ def get_install_path(): if install_path is None: # sys.path[0] is current module's path install_path = sys.path[1] + if install_path == ".frozen": + install_path = sys.path[2] install_path = expandhome(install_path) return install_path @@ -281,11 +283,11 @@ upip - Simple PyPI package manager for MicroPython Usage: micropython -m upip install [-p <path>] <package>... | -r <requirements.txt> import upip; upip.install(package_or_list, [<path>]) -If <path> is not given, packages will be installed into sys.path[1] -(can be set from MICROPYPATH environment variable, if current system -supports that).""" +If <path> isn't given, packages will be installed to sys.path[1], or +sys.path[2] if the former is .frozen (path can be set from MICROPYPATH +environment variable if supported).""" ) - print("Current value of sys.path[1]:", sys.path[1]) + print("Default install path:", get_install_path()) print( """\ |
