简体   繁体   中英

Error: package or namespace load failed for ‘gt’: object ‘faststack’ is not exported by 'namespace:fastmap'

I'm getting that error message when running

library(gt) 

You probably have an older version of fastmap . Run update.packages("fastmap") .

EDITED to add: A comment said that update.packages didn't work, but a new install did. A possible cause for weird behaviour like this is that you have two R libraries installed: a user library and a system library. They can each have different versions of the same package. update.packages() sees the newer one, but the code triggering the error uses the older one. .libPaths() will show the currently visible libraries, eg on my Mac I currently see

> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/4.1/Resources/library"

This is the system library. If I install a package somewhere else I'll probably see that path listed as well, but not necessarily if I restart R in another session. This can lead to very confusing behaviour.

One way to get into such a mess is to install some packages while running with admin privileges, and others without. The admin-installed packages will probably go into the system library, while the user-installed packages will go into a user library.

I just had to reinstall everything - R, and R Studio using the latest updates from CRAN. Then everything was fine.

有同样的问题 - 我通过更新我的所有软件包解决了它。

install.packages("fastmap")一眨眼就解决了我的问题,谢谢

You might get away with uninstalling fastmap, then reinstalling it. Rather than reinstalling everything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM