mac安装rpy2问题

这个问题就是有点奇怪,我在base环境中安装rpy2没有问题,但是我在QUEST环境中安装我就出现了问题,很奇怪的一个东西

错误如下

(QUEST) yxk@bogon ~ % pip install rpy2 
Collecting rpy2
  Using cached rpy2-3.5.14.tar.gz (219 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      ld: library not found for -lpcre2-8
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      Traceback (most recent call last):
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 266, in link
          self.spawn(linker + ld_args)
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn
          spawn(cmd, dry_run=self.dry_run, **kwargs)
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
          raise DistutilsExecError(
      distutils.errors.DistutilsExecError: command '/usr/bin/clang' failed with exit code 1
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/Users/yxk/anaconda3/envs/QUEST/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in 
          main()
        File "/Users/yxk/anaconda3/envs/QUEST/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/yxk/anaconda3/envs/QUEST/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "", line 137, in 
        File "", line 117, in get_r_c_extension_status
        File "", line 82, in get_c_extension_status
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 781, in link_executable
          self.link(
        File "/private/var/folders/9p/46z7jzkd4f7cd58_6_qrnmk40000gn/T/pip-build-env-zm6gbzr6/overlay/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 268, in link
          raise LinkError(msg)
      distutils.errors.LinkError: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

问题解决,这个问题出在R的版本安装上,我之前默认安装的R都是使用就的intel,实际上是有新的安装包,


所以这里涉及到怎么删除R的问题
https://www.imymac.com/powermymac/uninstall-r-mac.html

最重要的代码

sudo rm -rf /Library/Frameworks/R.framework

其余的部分rstudio和R可以通过应用程序直接删除

你可能感兴趣的:(macos,python,开发语言)