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

lets_plot_kotlin_bridge is unable to locate libc++.1.dylib, I am using Mac m2 #1234

Closed
dipunew opened this issue Nov 9, 2024 · 16 comments
Closed

Comments

@dipunew
Copy link

dipunew commented Nov 9, 2024

The error message indicates that the lets_plot_kotlin_bridge is still unable to locate libc++.1.dylib.

@alshan
Copy link
Collaborator

alshan commented Nov 12, 2024

Interesting, what kind of Python env are you using?

@VDovidaytis-HORIS
Copy link
Collaborator

Possible fix of the problem: 241ee55

@dipunew
Copy link
Author

dipunew commented Nov 19, 2024

@alshan and @VDovidaytis-HORIS

Thank you for your responses. I’m using Python 3.13 with pyenv as my environment.

I’ve also tried the suggested fix (241ee55), but unfortunately, the issue still persists.

@VDovidaytis-HORIS
Copy link
Collaborator

Could you provide more details, please:

  • full error output
  • macOS version
  • xcodebuild -version output
  • xcode-select -version output
  • PyEnv version and how did you install it.

I will try to reproduce the error.

@VDovidaytis-HORIS
Copy link
Collaborator

I’ve also tried the suggested fix (241ee55), but unfortunately, the issue still persists.

And let me clarify: how did you try the fix?

@keatingw
Copy link

Hi there, just chiming in that I have the same error on an M1 Max Macbook using Python 3.12.4 and lets-plot v4.5.1—hopefully this can help reproduce.

I tried to test the fix posted above but couldn't get Gradle building correctly (though admittedly didn't have much time to troubleshoot robustly).

Details:

  • macOS version: 14.7.1
  • no xcodebuild install, so xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
  • xcode-select version 2408

I'm using uv to set up an environment and install:

uv venv -p 3.12.4
uv pip install lets-plot
.venv/bin/python -c "from lets_plot import *"

Gives:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot/__init__.py", line 17, in <module>
    from .frontend_context import *
  File "/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot/frontend_context/__init__.py", line 6, in <module>
    from ._configuration import *
  File "/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot/frontend_context/_configuration.py", line 8, in <module>
    from ._html_contexts import _create_html_frontend_context, _use_isolated_frame, _create_wb_html_frontend_context
  File "/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot/frontend_context/_html_contexts.py", line 7, in <module>
    from ._jupyter_notebook_ctx import JupyterNotebookContext
  File "/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot/frontend_context/_jupyter_notebook_ctx.py", line 17, in <module>
    from .. import _kbridge as kbr
  File "/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot/_kbridge.py", line 7, in <module>
    import lets_plot_kotlin_bridge
ImportError: dlopen(/Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot_kotlin_bridge.cpython-312-darwin.so, 0x0002): Library not loaded: @rpath/libc++.1.dylib
  Referenced from: <C73BD5C1-9BE6-3DC6-8C81-759A39C12D94> /Users/<user>/Developer/lp-test/.venv/lib/python3.12/site-packages/lets_plot_kotlin_bridge.cpython-312-darwin.so
  Reason: tried: '/Users/vdovidaytis/Applications/miniconda3/envs/py312-arm/lib/libc++.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/vdovidaytis/Applications/miniconda3/envs/py312-arm/lib/libc++.1.dylib' (no such file), '/Users/vdovidaytis/Applications/miniconda3/envs/py312-arm/lib/libc++.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/vdovidaytis/Applications/miniconda3/envs/py312-arm/lib/libc++.1.dylib' (no such file)

Thank you!

@VDovidaytis-HORIS
Copy link
Collaborator

@keatingw, hello!

Thank you for your report!

First, let me ask you to try installing the dev wheel from this archive into your environment:

lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64.zip

Example:

pip uninstall lets-plot
unzip lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64.zip
pip install lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64/lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64.whl

This Python wheel contains the required fix.

@keatingw
Copy link

Confirming that dev wheel works from my end—the import error no longer occurs and I can render the quick start guide example plot. Thank you!

@paupereira
Copy link

I have the same problem but when I try the fix suggested by @VDovidaytis-HORIS and run pip install lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64/lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64.whl , I get the error ERROR: lets_plot-4.5.2.dev1-cp312-cp312-macosx_11_0_arm64.whl is not a supported wheel on this platform.

I'm on a Apple M2 Pro, macOS Sequoia 15.1, using python 3.12.

@VDovidaytis-HORIS
Copy link
Collaborator

@paupereira could you please show the output of the following command:

python -c "import platform; print(platform.machine())"

@quickcoffee
Copy link

quickcoffee commented Nov 26, 2024

I have the same error as @paupereira (is not a supported wheel on this platform.).
I'm on a Apple M1, macOS 14.5, using python 3.11.0.

could you please show the output of the following command:

@VDovidaytis-HORIS the output is arm64

@VDovidaytis-HORIS
Copy link
Collaborator

@quickcoffee this is because you tried to install my wheel, which is built for Python 3.12, on your Python 3.11.

Okay, everyone. We have made a dev release with the required fix for all platforms available on PyPI.org. Please check it out:

pip install lets-plot==4.5.2.dev1

@quickcoffee
Copy link

@VDovidaytis-HORIS my bad, thanks!

Can confirm that with 4.5.2.dev1 the error is gone 🥳

@paupereira
Copy link

4.5.2.dev1 fixed the issue :D
For the record, python -c "import platform; print(platform.machine())" returns arm64.

@dipunew
Copy link
Author

dipunew commented Nov 28, 2024

Thank you so much VDovidaytis!. lets-plot==4.5.2.dev1 is working.

@dipunew dipunew closed this as completed Nov 28, 2024
@VDovidaytis-HORIS
Copy link
Collaborator

Thank you so much VDovidaytis!. lets-plot==4.5.2.dev1 is working.

You're welcome! But keep in mind that this is a dev version — don't forget to update it to the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants