-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
pyenv arm64 builds confused by x86_64 libintl in /usr/local #1877
Comments
Caveats section in |
Thanks but |
So it's not keg-only -- and the build still can't find it. That's bad -- normally, programs form Homebrew are supposed to see non-keg-only libs out of the box. Apparently, you need to somehow make the build aware of the necessary library at where it is. Currently, I don't know what Pyenv can do here -- and more importantly, if it's even supposed to be doing anything or it's something else's job. |
#1853 suggests that Logically speaking. if you have two Homebrew installations for different architectures (thus different software ecosystems), you should have a separate Pyenv installation in each of them, and there should be some facility to choose which of these Homebrew installations you want to use -- so that you get the |
I don't need or want i386 builds of Python, so I don't need or want i386 pyenv. My problem is that I'm trying to do an arm build using pyenv configured to use arm (the only pyenv on my system), and it's trying to link the wrong copy of a library.
The problem is not that pyenv can't find this library. It's that I have two copies and it's finding the wrong instance of the library. This does not appear to happen for any other library that pyenv links, even though I have two copies of those (openssl, etc.) I also don't know if this is pyenv's responsibility, but it appears to know how to deal with this situation for other libraries, and is only struggling with gettext. |
Wait a second... That's Do you by any chance have It's also strange that I suspect that you're mixing up the two Homebrew installations and your Pyenv probably belongs to the x64 one. Please
|
First I want to say thank you very much for your patience on this issue! I'm aware I'm on the bleeding edge here, and doing something slightly unusual, and I really appreciate your taking the time to help me debug an issue that is quite likely not even a pyenv problem!
No.
Indeed! :-)
I don't have an i386 copy of pyenv.
(That looks weird to me!)
I'll post the build logs in the next comment. |
The logs were too long to post as comments, so here they are. Hope that's OK! |
Okay, Since it's not the default, unlike I didn't find any information on this and asked it at Homebrew/discussions#1423 . For now, this looks like some misconfiguration on your system. But if there actually is some mechanism provided by ARM64 Homebrew that 3rd-party programs must engage by hand, that would be Pyenv's issue. As a workaround, you can I suggest you to follow that ticket to diagnose this issue further and find out what needs to be done and report any findings here. |
@mikepqr Did the workaround work? |
Sorry for the delay. I will try to tomorrow. |
Confirmed. Explicitly setting However, simply removing the i386 homebrew installation in /usr/local (without explicitly setting any FLAGS!) also allows the installation to succeed. I just tested that too. It seems like the python build can find the libgettext libraries/headers in /opt/homebrew/. The problem is if those libraries also exist in /usr/local then the build (wrongly) uses those instead. Setting |
The flags helped me as well. Had to do one more step: |
I'm having this same issue on an M1 MacBook. Unlike the original author, I do not even have x86 emulated Homebrew installed into
I try to install Python 3.9.7 "universal" binary:
Does |
Building universal2 binaries seems to fail with openssl issues. I've tried many things but don't know how to move forward: user@computer client % export PYTHON_CONFIGURE_OPTS="--enable-framework --enable-universalsdk --with-universal-archs=universal2"
user@computer client % LDFLAGS="-L/opt/homebrew/lib" CPPFLAGS="-I/opt/homebrew/include" pyenv install 3.9.11
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.11.tar.xz...
-> https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tar.xz
Installing Python-3.9.11...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? EDIT: I eventually figured this out. The culprit is related to openssl being installed by homebrew not being a universal2 binary. You will literally need to download the openssl code, manually compile it for intel and arm, and then run the |
Documenting my situation for anyone in the similar situation as it was frustrating for many days to struggle with the same symptoms but nothing seemed to work. My Situation |
I've been struggling with this for hours now, gone through many bugs and tried every solution proposed. Could someone please just share their pre-compiled .dylib files? Specifically I just need _core and _imgcodecs. Would be greatly appreciated. Edit: I got it working by just installing homebrew and |
for M1 Mac, can try |
I was in the same situation. |
I was having similar issues and ended up fixing it like this:
Looks like it has something to do with having binutils from homebrew installed |
To synthesize above info with my exact error code and the solution: Goal - install python 3.11.0rc2 or 3.10.7 (or other versions) via e.g. Error -
Cause - I used Migration Assistant to migrate to M1 from non-M1 Mac. Some non-compatible stuff in Solution - from @jeugregg
This worked for me! |
I'm trying to follow homebrew's advice and supported workflow to configure a system with both arm64 and x86_64 brew packages, i.e. put an arm64 brew in /opt/homebrew and an x86 brew in /usr/local.
Both have a copy of the gettext package (which is a dependency of ... well ... pretty much everything).
The arm64 brew has pyenv.
pyenv install 3.9.4
fails with:But if I move/rename these three files in /usr/local it works fine (based on a clue in this comment:
I don't see any mention of /usr/local in the output of pyenv install. It appears to have correctly set up its paths. But these files in /usr/local determine whether it works or not.
brew doctor
does warn me that these files are likely to cause problems:but I was under the impression that pyenv goes to lengths to avoid getting confused by situations like this. There are copies of several libraries pyenv links in my /usr/local and /opt/homebrew, but pyenv gets the (correct) /opt/homebrew library every time, with the exception of these gettext libraries/headers.
Can anyone help me understand what's happening? Is this a situation pyenv could handle better? Or is it a brew problem? I assume simply deleting those files is not a good long term solution?
The text was updated successfully, but these errors were encountered: