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

install jep on mac M2 failed #502

Open
sunriseLe opened this issue Oct 15, 2023 · 5 comments
Open

install jep on mac M2 failed #502

sunriseLe opened this issue Oct 15, 2023 · 5 comments

Comments

@sunriseLe
Copy link

sunriseLe commented Oct 15, 2023

Describe the problem

  • I want to install jep with following command
    pip3 install jep
    
  • However it failed!
    image

Environment (please complete the following information):

  • Mac OS:

    • Apple M2 Pro with arm64
    • mac OS ventura 13.4 (Mac OS X)
    • uname -a

      Darwin xxx 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64

  • JDK:open jdk 17.0.6

    openjdk version "17.0.6" 2023-01-17
    OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
    OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode)
    
  • Python 3.9.6

    Python 3.9.6 (default, May  7 2023, 23:32:44) 
    [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
    
  • Jep Version: 4.1.1

@bsteffensmeier
Copy link
Member

The error indicates it is not able to find the python3.9 library. It is looking in /Applications/Xocde.app/Contents/Developer/Library/Framework/Python3.framework/Versions/3.9/lib but this directory does not exist. Is that the correct directory where your python is installed? I believe it is trying to find libpython3.9.dylib, so I recommend trying to find that file and figuring out why it is not in the directory where it is expecting it. On linux we occasionally see reports from people who can find libpython because they did not build python with the --enable-shared option so if you built python from source you may need to set that option.

@sunriseLe
Copy link
Author

  • I can find libpython3.9.dylib at following paths:
    /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/config-3.9-darwin/libpython3.9.dylib
    /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib
    
  • python on my mac is installed by Xcode, so I did not build python
  • So do I need to re_install Xcode? or other operations ? Thanks

@ndjensen
Copy link
Member

Your screenshot shows it's looking for the Python library under XCode but you have it installed elsewhere. I'm not sure why it's looking in the wrong place. The relevant part of the build is here in commands/python.py. If you want a quick and dirty fix, you could change that to use a hardcoded path of the directory like this

return ['-L{0}'.format('/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib')]

For a more permanent fix, I recommend searching online for how to set Xcode to use a specific Python that you've installed. Maybe that would make sysconfig.get_config_var('LIBDIR') return the right directory. If you figure it out, please come back and share what you've found as I doubt you'll be the only one to encounter this.

@icemachined
Copy link

You can use my distros as a Java dependency, https://github.com/icemachined/jep-distro.
It contains arm64 binaries for all python versions with numpy integration available.

@sunriseLe
Copy link
Author

sunriseLe commented Jan 15, 2024 via email

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

No branches or pull requests

4 participants