micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

venv creation fails when `sys.executable == ''`

Open NorthIsUp opened this issue 1 year ago • 0 comments

from venv

    # Add a `micropython` binary in $PATH pointing to this binary.
    if hasattr(sys, "executable"):
        os.system("cp {} {}".format(sys.executable, venv_bin_path + os.sep + "micropython"))

but on my local copy this happens

MicroPython v1.24.0 on 1980-01-01; darwin [GCC 4.2.1] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import sys
>>> sys.executable
''
>>>

so maybe it is best to add and sys.executable to the check?

    if hasattr(sys, "executable") and sys.executable:

NorthIsUp avatar Dec 09 '24 21:12 NorthIsUp