Skip to content

Commit 959e6f7

Browse files
committed
tools/upip.py: Skip '.frozen' entry in sys.path for install path.
Signed-off-by: Damien George <damien@micropython.org>
1 parent aac5a97 commit 959e6f7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/upip.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ def get_install_path():
262262
if install_path is None:
263263
# sys.path[0] is current module's path
264264
install_path = sys.path[1]
265+
if install_path == ".frozen":
266+
install_path = sys.path[2]
265267
install_path = expandhome(install_path)
266268
return install_path
267269

@@ -281,11 +283,11 @@ def help():
281283
Usage: micropython -m upip install [-p <path>] <package>... | -r <requirements.txt>
282284
import upip; upip.install(package_or_list, [<path>])
283285
284-
If <path> is not given, packages will be installed into sys.path[1]
285-
(can be set from MICROPYPATH environment variable, if current system
286-
supports that)."""
286+
If <path> isn't given, packages will be installed to sys.path[1], or
287+
sys.path[2] if the former is .frozen (path can be set from MICROPYPATH
288+
environment variable if supported)."""
287289
)
288-
print("Current value of sys.path[1]:", sys.path[1])
290+
print("Default install path:", get_install_path())
289291
print(
290292
"""\
291293

0 commit comments

Comments
 (0)