1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Windows10のRstanの実行エラー:Error in prep_call_sampler(object) :の対処

Last updated at Posted at 2021-08-08

1.実行環境

OS:windows10
R:Version 4.1.0 
Rstudio:Version 1.4.1717
rstan:2.21.2

2.トラブル

WindowsでRstanを動かすと、最近、このようなエラーが出て止まってしまうことが多くて困っていました。

console
Warning in system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
  'C:/Rtools/mingw_/bin/g++' not found
Error in prep_call_sampler(object) : 
  the compiled object from C++ code for this model is invalid, possible reasons:
  - compiled with save_dso=FALSE;
  - compiled on a different platform;
  - does not exist (created from reading csv files).

Warningは気にしなくてもよいみたいですが、Error in prep_call_sampler(object) :以下が出て止まります。

Ubuntu版RとWindows版Rの2つを使っていたのが悪かったのだろうかと思っていました。

3.解決!

gamen.png

作業ディレクトリの中のRdataファイルを削除して、Rstudioを再起動すると直りました。
Rの削除、再インストール、rstanのversionを落とす等もいろいろと試しましたが、最終的には実に簡単に直りました。

4.Enjoy

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?