tools/upip.py: Skip '.frozen' entry in sys.path for install path.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
aac5a97d08
commit
959e6f7da9
@ -262,6 +262,8 @@ def get_install_path():
|
|||||||
if install_path is None:
|
if install_path is None:
|
||||||
# sys.path[0] is current module's path
|
# sys.path[0] is current module's path
|
||||||
install_path = sys.path[1]
|
install_path = sys.path[1]
|
||||||
|
if install_path == ".frozen":
|
||||||
|
install_path = sys.path[2]
|
||||||
install_path = expandhome(install_path)
|
install_path = expandhome(install_path)
|
||||||
return 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>
|
Usage: micropython -m upip install [-p <path>] <package>... | -r <requirements.txt>
|
||||||
import upip; upip.install(package_or_list, [<path>])
|
import upip; upip.install(package_or_list, [<path>])
|
||||||
|
|
||||||
If <path> is not given, packages will be installed into sys.path[1]
|
If <path> isn't given, packages will be installed to sys.path[1], or
|
||||||
(can be set from MICROPYPATH environment variable, if current system
|
sys.path[2] if the former is .frozen (path can be set from MICROPYPATH
|
||||||
supports that)."""
|
environment variable if supported)."""
|
||||||
)
|
)
|
||||||
print("Current value of sys.path[1]:", sys.path[1])
|
print("Default install path:", get_install_path())
|
||||||
print(
|
print(
|
||||||
"""\
|
"""\
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user