Fix MacPorts OpenSSL formula detection#3417
Merged
native-api merged 4 commits intopyenv:masterfrom Mar 7, 2026
Merged
Conversation
- Modify prefer_openssl3 to detect MacPorts environment and use appropriate package names - Update use_macports_openssl to use PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA instead of PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA - Prevents 'Error: No available formula with the name [email protected]' when using MacPorts"
- Set both HOMEBREW and MACPORTS OpenSSL formula variables in prefer_openssl3 - Let individual functions check for package manager presence - Document PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA in python-build README
5 tasks
native-api
requested changes
Mar 7, 2026
Member
|
Push the changes to the PR branch (the "from " under the PR title) for them to be reflected here. |
- Set both HOMEBREW and MACPORTS OpenSSL formula variables in prefer_openssl3 - Let individual functions check for package manager presence - Document PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA in python-build README
native-api
approved these changes
Mar 7, 2026
Member
|
Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure you have checked all steps below.
Prerequisite
https://github.com/rbenv/rbenvFix MacPorts OpenSSL formula detection #3416
Description
Here are some details about my PR
Fixed the issue where pyenv tries to find non-existent Homebrew package names (like [email protected]) in MacPorts environment, causing installation failures.
prefer_openssl3to set both HOMEBREW and MACPORTS OpenSSL formula variablesprefer_openssl3PYTHON_BUILD_MACPORTS_OPENSSL_FORMULAenvironment variable in READMETests
My PR adds the following unit tests (if any)
Tested Python 3.11.15 installation in MacPorts environment, confirming that the "Error: No available formula" error no longer occurs.
Test environment:
Additional Context
This issue affects users who use MacPorts instead of Homebrew as their package manager on macOS. The root cause is that MacPorts uses different package naming conventions (without the @ symbol) compared to Homebrew. When pyenv tries to find Homebrew-style package names in MacPorts, it fails with the error "Error: No available formula with the name '[email protected]'".
This fix makes pyenv more package manager-agnostic by detecting the environment and using appropriate package names.