# error message "Failed to find python interpreter for CLI"

**URL:** <https://discourse.slicer.org/t/error-message-failed-to-find-python-interpreter-for-cli/4749>\
**Category:** Support\
**Tags:** build\
**Created:** [November 13, 2018, 2:45pm UTC](https://discourse.slicer.org/t/error-message-failed-to-find-python-interpreter-for-cli/4749 "2018-11-13T14:45:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ueda](https://avatars.discourse-cdn.com/v4/letter/u/e19b73/32.png) [@ueda](https://discourse.slicer.org/u/ueda)\
**Post date:** [November 13, 2018, 2:45pm UTC](https://discourse.slicer.org/t/error-message-failed-to-find-python-interpreter-for-cli/4749/1 "2018-11-13T14:45:31Z")

</div>

Operating system: ubuntu16.04  
Slicer version:4.11.0-2018-11-08  
Expected behavior:Non error messages  
Actual behavior:Error(s): Failed to find python interpreter for CLI

Hellow.  
I’m a beginner at python and 3D slicer.  
When I activate the 3D slicer from the terminal, I get the following error message:

Error(s):  
Failed to find python interpreter for CLI: /home/ueda/bin/Slicer-SuperBuild/Slicer-build/lib/Slicer-4.11/cli-modules/PyCLIModule4Test.py  
Fail to instantiate module “PyCLI4Test”  
Object::connect: No such signal qSlicerGPUMemoryComboBox::currentTextChanged(QString) in /home/ueda/bin/Slicer/Modules/Loadable/VolumeRendering/qSlicerVolumeRenderingSettingsPanel.cxx:116  
Object::connect: (sender name: ‘GPUMemoryComboBox’)  
Object::connect: (receiver name: ‘qSlicerVolumeRenderingSettingsPanel’)  
Switch to module: “Welcome”

How can I solve this error message?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 15, 2018, 2:00am UTC](https://discourse.slicer.org/t/error-message-failed-to-find-python-interpreter-for-cli/4749/2 "2018-11-15T02:00:20Z")

</div>

Python CLIs are only available if Slicer is built with Qt5.

@ihnorton, What’s the reason behind trying to find “python” executable [here](https://github.com/Slicer/Slicer/blob/60adeea3e15d3640e9f68bc8abb6bf1d45b32624/Base/QTCLI/qSlicerCLIExecutableModuleFactory.cxx#L41)? Can the CLI executed by an any Python interpreter? How do you tell if you want to run the Python file using Slicer’s Python interpreter or another one?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 19, 2018, 5:09pm UTC](https://discourse.slicer.org/t/error-message-failed-to-find-python-interpreter-for-cli/4749/3 "2018-11-19T17:09:37Z")

</div>

> [@lassoan](#):
>
> What’s the reason behind trying to find “python” executable [here](https://github.com/Slicer/Slicer/blob/60adeea3e15d3640e9f68bc8abb6bf1d45b32624/Base/QTCLI/qSlicerCLIExecutableModuleFactory.cxx#L41)? Can the CLI executed by an any Python interpreter?

That was to make it work with a local build.

> [@lassoan](#):
>
> How do you tell if you want to run the Python file using Slicer’s Python interpreter or another one?

I don’t think there is a way to do that right now. A couple ideas:

- tell people to use the PyCLI as a wrapper to call some other arbitrary command with the correct environment, arguments, etc.
- do what `bash` does: parse the `#!` line, use that as either absolute path or a target to search for in PATH (ignoring `/usr/bin/env` if present, at least on Windows). This would be nice because it would work for arbitrary interpreters, but would be tricky because people would need to either arrange their PATH properly, or use an install-step to put the correct absolute path in place (this is what anaconda does, and it works very well).
- expose `ModuleDescription`: then people could call `setEntryPoint`on the CLI object as needed (actually this might already be possible with a `vtkMRMLCommandLineModuleNode`)
