Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem installing on mac #1090

Open
roybka opened this issue Feb 4, 2024 · 5 comments
Open

problem installing on mac #1090

roybka opened this issue Feb 4, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@roybka
Copy link

roybka commented Feb 4, 2024

Describe the issue or bug

Running 'pip install rpy2' gives error on new (m1) mac (OS monterey 12.2).

To Reproduce

run pip install rpy2 on new mac.

Expected behavior
successful installation.

Error
Collecting rpy2
Using cached rpy2-3.5.15.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/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/overlay/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 266, in link
self.spawn(linker + ld_args)
File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/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/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/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/amitr2/.pyenv/versions/miniforge3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/amitr2/.pyenv/versions/miniforge3/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/amitr2/.pyenv/versions/miniforge3/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/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 141, in <module>
    File "<string>", line 121, in get_r_c_extension_status
    File "<string>", line 82, in get_c_extension_status
    File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/overlay/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 781, in link_executable
      self.link(
    File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-hfpdb8k7/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.

Additional context
I can type 'R' in the same console where I pip install from, and get an R cmd line.

@roybka roybka added the bug Something isn't working label Feb 4, 2024
@chiara111p111
Copy link

Hi roybka,

I had the same problem and I solved today by installing the version 3.5.12, instead of the latest one.
pip3 install rpy2==3.5.12

Hope this can help,
Chiara

@roybka
Copy link
Author

roybka commented Feb 7, 2024

@chiara111p111 Solved! thanks a lot.
I think I'll keep this open since the authors of the repo might want to fix it in the current version.

@lgautier
Copy link
Member

Can you share the output of running

pip install -v -U rpy2

?

In particular, I am interested in the section that reports the R setup and the C libraries. It should start with
something like:

Building wheels for collected packages: rpy2
  Running command Building wheel for rpy2 (pyproject.toml)
  cffi mode is CFFI_MODE.ANY
  Looking for R home with: R RHOME
  R home found: /usr/local/packages/R/4.3/lib/R
  R exec path: /usr/local/packages/R/4.3/lib/R/bin/R
(...)

@roybka
Copy link
Author

roybka commented Feb 11, 2024

Voila

Collecting rpy2
Using cached rpy2-3.5.15.tar.gz (219 kB)
Running command pip subprocess to install build dependencies
Looking in indexes: http://nutrino:****@pypi.nutrino.co/simple
Ignoring packaging: markers 'platform_system == "Windows"' don't match your environment
Collecting setuptools>=61
Using cached setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
Collecting wheel
Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
Collecting cffi>=1.15.0
Using cached cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=1.15.0)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached setuptools-69.0.3-py3-none-any.whl (819 kB)
Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
Using cached cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl (176 kB)
Installing collected packages: wheel, setuptools, pycparser, cffi
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
services-commons 0.2.24 requires requests==2.22.0, but you have requests 2.31.0 which is incompatible.
services-commons 0.2.24 requires typing-extensions==3.7.4.3, but you have typing-extensions 4.7.1 which is incompatible.
spacy-transformers 1.2.5 requires transformers<4.31.0,>=3.4.0, but you have transformers 4.36.2 which is incompatible.
tensorboard 2.9.1 requires protobuf<3.20,>=3.9.2, but you have protobuf 3.20.0 which is incompatible.
tensorboard 2.9.1 requires werkzeug>=1.0.1, but you have werkzeug 0.16.0 which is incompatible.
tensorflow-macos 2.9.2 requires protobuf<3.20,>=3.9.2, but you have protobuf 3.20.0 which is incompatible.
Successfully installed cffi-1.16.0 pycparser-2.21 setuptools-69.0.3 wheel-0.42.0
Installing build dependencies ... done
Running command Getting requirements to build wheel
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/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/overlay/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 266, in link
self.spawn(linker + ld_args)
File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/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/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/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/amitr2/.pyenv/versions/miniforge3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Users/amitr2/.pyenv/versions/miniforge3/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/amitr2/.pyenv/versions/miniforge3/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/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 141, in
File "", line 121, in get_r_c_extension_status
File "", line 82, in get_c_extension_status
File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/overlay/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 781, in link_executable
self.link(
File "/private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-build-env-sv7c2bp8/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
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.
full command: /Users/amitr2/.pyenv/versions/miniforge3/bin/python3.9 /Users/amitr2/.pyenv/versions/miniforge3/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/tmp2dfufoy3
cwd: /private/var/folders/2n/ylg3knfx2px41qbz6z60yt_h0000gn/T/pip-install-fatz4r1t/rpy2_c5b2cc74f60241668a0c2f2bfd23e3a2
Getting requirements to build wheel ... error
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.

@lgautier
Copy link
Member

lgautier commented Mar 2, 2024

The CI pipeline is now building "universal" binary on silicon, although with warnings.
See https://github.com/rpy2/rpy2/actions/runs/8106498299/job/22156525623#step:6:308 and following lines.

The library pcre2-8, that is missing on your system, is present there (but built for a different architecture).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants