Skip to content

Commit

Permalink
tools/upip.py: Skip '.frozen' entry in sys.path for install path.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Dec 29, 2021
1 parent aac5a97 commit 959e6f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/upip.py
Expand Up @@ -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

Expand All @@ -281,11 +283,11 @@ def help():
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(
"""\
Expand Down

0 comments on commit 959e6f7

Please sign in to comment.