Skip to content

Commit d0c00f4

Browse files
committed
Update install error messages
Closes #558
1 parent f3a2b6e commit d0c00f4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cmdstanpy/utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ def validate_cmdstan_path(path: str) -> None:
148148
raise ValueError(f'No CmdStan directory, path {path} does not exist.')
149149
if not os.path.exists(os.path.join(path, 'bin', 'stanc' + EXTENSION)):
150150
raise ValueError(
151-
'CmdStan installataion missing binaries, run "install_cmdstan"'
151+
'CmdStan installataion missing binaries. '
152+
'Re-install cmdstan by running command "install_cmdstan '
153+
'--overwrite", or Python code "import cmdstanpy; '
154+
'cmdstanpy.install_cmdstan(overwrite=True)"'
152155
)
153156

154157

@@ -178,14 +181,14 @@ def cmdstan_path() -> str:
178181
cmdstan_dir = os.path.expanduser(os.path.join('~', _DOT_CMDSTAN))
179182
if not os.path.exists(cmdstan_dir):
180183
raise ValueError(
181-
'No CmdStan installation found, run "install_cmdstan" or'
182-
' (re)activate your conda environment!'
184+
'No CmdStan installation found, run command "install_cmdstan"'
185+
'or (re)activate your conda environment!'
183186
)
184187
latest_cmdstan = get_latest_cmdstan(cmdstan_dir)
185188
if latest_cmdstan is None:
186189
raise ValueError(
187-
'No CmdStan installation found, run "install_cmdstan" or'
188-
' (re)activate your conda environment!'
190+
'No CmdStan installation found, run command "install_cmdstan"'
191+
'or (re)activate your conda environment!'
189192
)
190193
cmdstan = os.path.join(cmdstan_dir, latest_cmdstan)
191194
os.environ['CMDSTAN'] = cmdstan

0 commit comments

Comments
 (0)