dephell icon indicating copy to clipboard operation
dephell copied to clipboard

Error: dephell tries to access Windows Python from WSL2 shell

Open jtiai opened this issue 4 years ago • 0 comments

Short description

When executing dephell venv create dephell tries to locate all existing Python installations including ones that are on Windows side in WSL2 shell and trying to execute it and dephell crashes to traceback.

Output

Traceback as below.

Steps to reproduce

Make sure that both Windows and WSL has Python installed and both are in path at WSL side

$ dephell venv create

Traceback

$ dephell venv create --traceback
INFO creating venv for project... (path=.venv)
ERROR OSError: [Errno 8] Exec format error: '/mnt/c/Users/jtiai/AppData/Local/Microsoft/WindowsApps/python.exe'
Traceback (most recent call last):
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell/cli.py", line 66, in main
    result = handler()
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell/commands/venv_create.py", line 34, in __call__
    python = get_python(self.config)
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell/actions/_python.py", line 36, in get_python
    return pythons.get_best(python)
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell_pythons/_pythons.py", line 97, in get_best
    python = self.get_by_version(version)
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell_pythons/_pythons.py", line 123, in get_by_version
    for python in self:
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell_pythons/_pythons.py", line 159, in __iter__
    yield from self.finder.pythons
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell_pythons/_cached_property.py", line 17, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell_pythons/_finder.py", line 74, in pythons
    version=Version(self.get_version(path)),
  File "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell_pythons/_finder.py", line 94, in get_version
    result = subprocess.run([str(path), '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python3.8/subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/mnt/c/Users/jtiai/AppData/Local/Microsoft/WindowsApps/python.exe'
...

Config

[tool.dephell.main]
<redacted due company policy>
...

Versions

{
  "cache": "4.97Mb",
  "path": "/home/jtiai/.local/share/dephell/venvs/dephell/lib/python3.8/site-packages/dephell",
  "python": "/home/jtiai/.local/share/dephell/venvs/dephell/bin/python3",
  "version": "0.8.3",
  "versions": {
    "dephell-archive": "0.1.7",
    "dephell-argparse": "0.1.3",
    "dephell-changelogs": "0.0.1",
    "dephell-discover": "0.2.10",
    "dephell-licenses": "0.1.7",
    "dephell-links": "0.1.5",
    "dephell-markers": "1.0.3",
    "dephell-pythons": "0.1.15",
    "dephell-setuptools": "0.2.4",
    "dephell-shells": "0.1.5",
    "dephell-specifier": "0.2.2",
    "dephell-venvs": "0.1.18",
    "dephell-versioning": "0.1.2"
  }
}

jtiai avatar Dec 01 '20 08:12 jtiai