Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/cubitpy/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,20 @@ def get_cubit_interpreter(cls):
cubit_python_interpreter = python3_files[0]
return cubit_python_interpreter
else:
python2_path_env = get_path(
"CUBITPY_PYTHON2", os.path.isfile, throw_error=False
)
if python2_path_env is not None:
return python2_path_env

if shutil.which("python2.7") is not None:
return "python2.7"

imcs_python2_path = "/imcs/public/compsim/opt/Python-2.7.18/python"
if os.path.exists(imcs_python2_path):
return imcs_python2_path

raise ValueError("Could not find a python2 interpreter")
raise ValueError(
"Could not find a python2 interpreter. "
"You can specify this by setting the environment variable "
"CUBITPY_PYTHON2 to the path of your python2 interpreter."
)

@classmethod
def is_coreform(cls):
Expand Down