How to select python interpreter in Slicer on VSCode?

wrc
Mon, 05 Jun 2023 08:24:42 +0000
Development

Hello, I failed to select python interpreter in Slicer on VSCode. The system is MacOS 13.4. I also tried other IDE but no success. However, I can run python script by python interpreter in Slicer from Terminal.

Here is the error information:

[error] [Error: Command failed: /Applications/Slicer.app/Contents/bin/PythonSlicer -I /Users/admin/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/get_output_via_markers.py /Users/admin/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/interpreterInfo.py
error: Application is NOT executable [/Applications/Slicer.app/Contents/bin/./python-real]
Usage
  PythonSlicer [options]

Options
  --launcher-help                                 Display help
  --launcher-version                              Show launcher version information
  --launcher-verbose                              Verbose mode
  --launch                                        Specify the application to launch
  --launcher-detach                               Launcher will NOT wait for the application to finish
  --launcher-no-splash                            Hide launcher splash
  --launcher-timeout                              Specify the time in second before the launcher kills the application. -1 means no timeout (default: -1)
  --launcher-load-environment                     Specify the saved environment to load.
  --launcher-dump-environment                     Launcher will print environment variables to be set, then exit
  --launcher-show-set-environment-commands        Launcher will print commands suitable for setting the parent environment (i.e. using 'eval' in a POSIX shell), then exit
  --launcher-additional-settings                  Additional settings file to consider
  --launcher-additional-settings-exclude-groups   Comma separated list of settings groups that should NOT be overwritten by values in User and Additional settings. For example: General,Application,ExtraApplicationToLaunch
  --launcher-ignore-user-additional-settings      Ignore additional user settings
  --launcher-generate-exec-wrapper-script         Generate executable wrapper script allowing to set the environment
  --launcher-generate-template                    Generate an example of setting file

at ChildProcess.exithandler (node:child_process:409:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1112:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: '/Applications/Slicer.app/Contents/bin/PythonSlicer -I /Users/admin/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/get_output_via_markers.py /Users/admin/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/interpreterInfo.py'
}

10 posts - 3 participants