在服务器上安装R,报错没有pcre2:"configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support"
安装pcre2,在编译make install时报错:
make[2]: Entering directory '/home/pcre2-10.39'
/bin/mkdir -p '/usr/local/lib'
/bin/sh ./libtool --mode=install /usr/bin/install -c libpcre2-8.la libpcre2-posix.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libpcre2-8.so.0.10.4 /usr/local/lib/libpcre2-8.so.0.10.4
/usr/bin/install: cannot create regular file '/usr/local/lib/libpcre2-8.so.0.10.4': Permission denied
Makefile:1535: recipe for target 'install-libLTLIBRARIES' failed
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory '/home/pcre2-10.39'
Makefile:3224: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/pcre2-10.39'
Makefile:3217: recipe for target 'install' failed
make: *** [install] Error 2
尝试sodu make install,但是没有管理员权限,无法切换到root。
请问如何解决?
回答不易,求求您采纳哦 感激不尽
如果您在服务器上安装 R,但是没有管理员权限,并且在安装 pcre2 的时候遇到了问题,可以尝试以下几种解决方法:
使用可以在不需要管理员权限的方式安装 pcre2,例如通过使用源代码编译并安装。
使用 R 包管理器安装 pcre2,例如通过使用 install.packages() 函数安装。
向系统管理员请求协助,请求其安装 pcre2。
如果系统管理员不愿意安装 pcre2,则可以尝试在自己的目录中安装 pcre2。
如果您决定在自己的目录中安装 pcre2,请确保您已经安装了所需的编译器和依赖包,并且已经从源代码编译并安装了 pcre2。然后,您可以通过指定搜索路径来告诉 R 如何找到 pcre2,例如:
./configure --with-pcre2-include=/path/to/pcre2/headers \
--with-pcre2-lib=/path/to/pcre2/library
这样,R 就可以找到安装在您目录中的 pcre2 库,并且不需要管理员权限。
以下答案引用自GPT-3大模型,请合理使用:
。
除此之外,可以尝试使用sudo权限安装pcrel2。
sudo make install
或者
sudo -i
cd /home/pcre2-10.39
./configure --prefix=/usr
make
sudo make install