when I start Desktop Rstudio every time, I get an error message as:rstudio error yaml.load readlin con errorlevel errorlevel - rstudio

after I login the Desktop Rstudio, the following message will appear:
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) :
object 'C_unserialize_from_yaml' not found
and I try to reinstall R and Rstudio with the newest program,it still appear error again.
when I start R program ,it can work with no error. Only Rstudio, and I try to rename the directory"C:\Users\Administrator\AppData\Local\RStudio-Desktop" in another name, Let it create when Rstudio launch,the error message again.
And I can't knit some Rmd file working normal, it will appear following error:
Error in yaml::yaml.load(string, ...) :
找不到对象'C_unserialize_from_yaml'
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load_utf8 -> <Anonymous>
停止执行
Who can help me to slove the problem.Thanks very much.

I reverted to yaml R package version 2.1.14 and it fixed it for me.
https://cran.r-project.org/src/contrib/Archive/yaml/
Use this R command to install the package from source (provided the working directory is set to where the R package is):
install.packages("yaml_2.1.14.tar.gz", repos = NULL)

You can do it by
require(devtools)
install_version("yaml", version = "2.1.14", repos = "http://cran.us.r-project.org")
It resolved my issue

Related

AttributeError: 'Ghostscript' object has no attribute '_instance'

In my university semester project we are attempting to use ghostscript on some PDF files, however when we try to run our code, we get the error:
AttributeError: 'Ghostscript' object has no attribute '_instance'
We have tried various attempts to fix this, however have not found a solution yet. The only part in which we are using ghostscript is the following code:
ar = ["-sDEVICE=pdfwrite", "-dPDFSETTINGS=/prepress", "-dQUIET", "-dBATCH", "-dNOPAUSE", "-dPDFSETTINGS=/printer", "-sOutputFile=" + os.path.join(filepath, file), os.path.join(filepath, file)]
gs = ghostscript.Ghostscript(*ar)
del gs
We are using Python-3.8 and PyPi Ghostscript 0.7.
Has anyone else encountered this error or does anyone know how to fix it?
Apparently the order in which you pass the arguments is important. So instead of having:
ar = ["-sDEVICE=pdfwrite", "-dPDFSETTINGS=/prepress", "-dQUIET", "-dBATCH", "-dNOPAUSE", "-dPDFSETTINGS=/printer", "-sOutputFile=" + os.path.join(filepath, file), os.path.join(filepath, file)]
We now have:
ar = ["-dQUIET", "-dBATCH", "-dNOPAUSE", "-sDEVICE=pdfwrite", "-dPDFSETTINGS=/prepress", "-dPDFSETTINGS=/printer", "-sOutputFile=" + os.path.join(filepath, file), os.path.join(filepath, file)]
This solved the issue for us.

Getting error when trying to install R Package "Tidytext"

Error: package or namespace load failed for ‘tidytext’ in library.dynam(lib, package, package.lib): shared object ‘stringi.so’ not found
6.
stop(msg, call. = FALSE, domain = NA)
5.
value[3L]
4.
tryCatchOne(expr, names, parentenv, handlers[[1L]])
3.
tryCatchList(expr, classes, parentenv, handlers)
2.
tryCatch({ attr(package, "LibPath") <- which.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps) ...
1.
library(tidytext)
upon running
tidyverse:::tidyverse_attach()
tidyverse:::tidyverse_conflicts()
> tidyverse:::tidyverse_attach()
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
> tidyverse:::tidyverse_conflicts()
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
Try running install.packages('stringi')
See this issue thread for more details: https://github.com/bvieth/powsimR/issues/20
I personally found that when my OS updates R, all of my downloaded packages get broken in some weird way. I've yet to find a fix for it.

Failed to add gRPC as dependency to other Bazel project on macOS

I am building my C++ project using Bazel on macOS, and I added the gRPC as one of the deps
FYI, I successfully built with same settings on Linux, however, it fails for me on macOS.
WORKSPACE
git_repository(
name = "com_github_grpc_grpc",
remote = "https://github.com/grpc/grpc",
tag = "v1.20.1"
)
load("#com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
and the build file for my module
a.BUILD
cc_library(
name = "s12",
srcs = glob(
["**/*.cc"],
),
hdrs = glob(
["**/*.h",],
),
deps = [
"#com_github_grpc_grpc//:grpc++",
"#com_google_protobuf//:protobuf",
],
)
and in linking stage I got following error:
[libprotobuf ERROR external/com_github_sc_protobuf/src/google/protobuf/descriptor_database.cc:58] File already exists in database: google/protobuf/descriptor.proto
[libprotobuf FATAL external/com_github_sc_protobuf/src/google/protobuf/descriptor.cc:1370] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
external/bazel_tools/tools/test/test-setup.sh: line 310: 63268 Abort trap: 6 "${TEST_PATH}" "$#" 2>&1
Apparently, some file is included multiple times, however, I couldn't figure out why.

cctools-binutils-darwin/bin/ranlib failed, malformed object (unknown load command)

I am attempting to build the gitlib-libgit2 Haskell package on macos via nix in roughly the following manner.
mkdir nix-repro && cd nix-repro
cabal2nix --no-check cabal://gitlib-libgit2 > gitlib-libgit2.nix
echo '(import <nixpkgs> {}).haskellPackages.callPackage ./gitlib-libgit2.nix {}' > default.nix
nix-build
I am seeing the following warnings and error:
ld: warning: /nix/store/spx9xz1jv3yhmqw8y3agki1fvdr2x2fv-libiconv-osx-10.11.6/lib/libiconv.dylib, ignoring unexpected dylib file
ld: warning: /nix/store/spx9xz1jv3yhmqw8y3agki1fvdr2x2fv-libiconv-osx-10.11.6/lib/libiconv.dylib, ignoring unexpected dylib file
/nix/store/s33984hx2gwcg2d4dgpcm4342md19qvh-cctools-binutils-darwin/bin/ranlib: object: dist/build/libHSgitlib-libgit2-3.1.2.1-1fYQZMedHRP3aXiBXJFDO2-ghc8.6.3.a(s2_meth.o) malformed object (unknown load command 1)
`ranlib' failed in phase `Ranlib'. (Exit code: 1)
builder for '/nix/store/yrran1p69pvdq1b34jqfq7dmd95j9fh9-gitlib-libgit2-3.1.2.1.drv' failed with exit code 1
error: build of '/nix/store/yrran1p69pvdq1b34jqfq7dmd95j9fh9-gitlib-libgit2-3.1.2.1.drv' failed
What does this mean, and how can I go about fixing it?
It only fails this way on macos, as far as I can tell. I'm on nixpkgs-unstable. I am able to build this package using other tools, so the failure must be something specific to the nix tooling I'm using to build it.
$ cat $HOME/.nix-defexpr/channels/nixpkgs/.git-revision
6e5caa3f8ac48750233ef82a94825be238940825
Here's the full gitlib-libgit2.nix expression if you don't want to run cabal2nix for yourself:
{ mkDerivation, base, bytestring, conduit, conduit-combinators
, containers, directory, exceptions, fast-logger, filepath, gitlib
, gitlib-test, hlibgit2, hspec, hspec-expectations, HUnit, mmorph
, monad-loops, mtl, resourcet, stdenv, stm, stm-conduit, tagged
, template-haskell, text, text-icu, time, transformers
, transformers-base, unliftio, unliftio-core
}:
mkDerivation {
pname = "gitlib-libgit2";
version = "3.1.2.1";
sha256 = "b90e0ad2e7e0f58379e02cbe60d2900c95f0a255c34bd3461f8ee5753a6aa23e";
libraryHaskellDepends = [
base bytestring conduit conduit-combinators containers directory
exceptions fast-logger filepath gitlib hlibgit2 mmorph monad-loops
mtl resourcet stm stm-conduit tagged template-haskell text text-icu
time transformers transformers-base unliftio unliftio-core
];
testHaskellDepends = [
base exceptions gitlib gitlib-test hspec hspec-expectations HUnit
transformers
];
doCheck = false;
description = "Libgit2 backend for gitlib";
license = stdenv.lib.licenses.mit;
}

i am a beginner in Rstudio !! my doublt is regarding = installing devtools

library(devtools)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘bitops’
Error: package or namespace load failed for ‘devtools’
Try:
install.packages("bitops")

Resources