File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,20 @@ def get_cubit_interpreter(cls):
135135 cubit_python_interpreter = python3_files [0 ]
136136 return cubit_python_interpreter
137137 else :
138+ python2_path_env = get_path (
139+ "CUBITPY_PYTHON2" , os .path .isfile , throw_error = False
140+ )
141+ if python2_path_env is not None :
142+ return python2_path_env
143+
138144 if shutil .which ("python2.7" ) is not None :
139145 return "python2.7"
140146
141- imcs_python2_path = "/imcs/public/compsim/opt/Python-2.7.18/python"
142- if os . path . exists ( imcs_python2_path ):
143- return imcs_python2_path
144-
145- raise ValueError ( "Could not find a python2 interpreter" )
147+ raise ValueError (
148+ "Could not find a python2 interpreter. "
149+ "You can specify this by setting the environment variable "
150+ "CUBITPY_PYTHON2 to the path of your python2 interpreter."
151+ )
146152
147153 @classmethod
148154 def is_coreform (cls ):
You can’t perform that action at this time.
0 commit comments