#193: Update Python Dependency to Python3 in CMakeLists.txt for EnvelopeProblemSOS #336
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.
This pull request updates the CMakeLists.txt file for the EnvelopeProblemSOS example to use Python3 instead of Python2. Since Python2 is no longer officially supported and many systems default to Python3, this change is intended to make it easier for contributors to build and work with this project.
Changes Made:
🔹Updated CMakeLists.txt to find and link Python3 instead of Python2:
🔹Replaced find_package(Python2 COMPONENTS Development NumPy) with find_package(Python3
COMPONENTS Development NumPy REQUIRED).
🔹Replaced target_link_libraries(EnvelopeProblem Python2::Python Python2::NumPy) with
target_link_libraries(EnvelopeProblem Python3::Python Python3::NumPy).
Why this is needed:
1.Python2 has reached end-of-life, so this removes the need for contributors to set up legacy dependencies.
2.Compatibility: This update makes building the project simpler for anyone using modern systems.
3.Long-term maintenance: Staying up-to-date with Python3 ensures fewer issues going forward and makes it easier for new developers to jump in.
I’ve tested these changes to make sure the example builds successfully with Python3, and everything seems to be working smoothly.