jep
jep copied to clipboard
install jep on mac M2 failed
Describe the problem
- I want to install jep with following command
pip3 install jep
- However it failed!
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
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.
- 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
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.
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.
你好,我是李晓芳,我已收到你的邮件,我会定时查看的。欢迎经常联系