Choose new interpreter from Conda is not responding

Hello,

I’m new to Python4Capella and trying to set-up the python interpreters. I’m using mac os 13.4 and I have python installed via miniconda
When I go to “Preferences”>“PyDev”>“Interpreters”>“Python interpreter” then select “New”>“Choose from Conda” nothing happens.
I tried “Config Conda” and selected the Conda executable in a virtual env, i.e. “/Users/ea/miniconda3/envs/capylla/bin/python3.10” but still when I select “New”>“Choose from Conda” nothing happens.

Appreciate your help on how to solve this.

Hello,

It seems that you did not select the expected conda executable.
In you case, it should be: /Users/ea/miniconda3/bin/conda, then conda will locate its Python interpreter.

Regards


With macOS 13.5, Capella 6.1, Python4Capella add-on installed.

Python 3.11.4 installed with Homebrew 4.1.4

To have Python for Capella working, I followed the following steps:

  • in Capella > Settings > PyDev > Interpreters > Python Interpreters
    • or New… > Choose from list
      • choose one of the discovered python
        • /usr/local/bin/python or /usr/local/bin/python3 (which python or which python3 to check where points those aliases)
        • /opt/homebrew/bin/python3 for python installed via brew
        • /usr/bin/python3 for Python provided by XCode (3.9.6 on my side)
  • in Capella > Settings > Scripting > Python Scripting (Using Py4J)
  • Python location set to the the same Python than PyDev (same command name from PATH, or absolute location of the same interpreter from previous section)
  • Then fall back to default Python4Capella configuration steps to have Python4Capella project in script locations.

Python 3.11.3 installed with Conda

Miniconda3 py311_23.5.2-0

conda list
...
python                    3.11.4               hb885b13_0  
python.app                3               py311h80987f9_0
...

To have Python for Capella working, I followed the following steps:

  • in Capella > Settings > PyDev > Interpreters > Python Interpreters
    • or New… > Choose from Conda
      • it asked me for the conda executable
        • after executing where conda in a terminal to see the location where conda has been installed,
        • I used the browse button to locate and select the conda executable file which is for me /Users/userLogin/miniconda3/bin/conda
        • miniconda3 appears a a Python interpreter (unique one on my side after cleanup)
  • in Capella > Settings > Scripting > Python Scripting (Using Py4J)
    • I browsed to select the python3 file located in /Users/userLogin/miniconda3/bin/python3 (symbolic link, after validation I see /Users/userLogin/miniconda3/bin/python3.11 in the Python location)

Python from path

I I redo the whole configuration with New… > Config first in PATH in Python interpreters preference page and python in Python scripting page, it also works but this time it takes python from the System / Xcode installation:
Python version: 3.9.6 (default, May 7 2023, 23:32:44)
Executable path: /Applications/Xcode.app/Contents/Developer/usr/bin/python3

Addition to sample script

I have added the following snippet to the List_logical_functions_in_console.py sample script to check which Python version was executed when running the “List logical functions in console” menu from contextual menu of a Capella element displayed in Project Explorer view:

import sys
print("Python version:")
print (sys.version)
print("Version info:")
print(sys.version_info)
print("Executable path:")
print(sys.executable)

Regards

1 Like

Thanks Maxime, that was helpful.