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

Python certificates on OSX #1207

Closed
designerfuzzi opened this issue Mar 23, 2023 · 2 comments · Fixed by #1355
Closed

Python certificates on OSX #1207

designerfuzzi opened this issue Mar 23, 2023 · 2 comments · Fixed by #1355

Comments

@designerfuzzi
Copy link

designerfuzzi commented Mar 23, 2023

addressing the install issue on macOS

$ ./emsdk install latest
emsdk will use /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
Resolving SDK alias 'latest' to '3.1.34'
Resolving SDK version '3.1.34' to 'sdk-releases-2fdd6b9e5b67d5b62f84d0501a876513ff118ef1-64bit'
Installing SDK 'sdk-releases-2fdd6b9e5b67d5b62f84d0501a876513ff118ef1-64bit'..
Installing tool 'node-14.18.2-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v14.18.2-darwin-x64.tar.gz': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
Warning: Possibly SSL/TLS issue. Update or install Python SSL root certificates (2048-bit or greater) supplied in Python folder or https://pypi.org/project/certifi/ and try again.
error: installation failed!

emsdk/emsdk

Line 46 in a2ccccb

exec "$EMSDK_PYTHON" "$0.py" "$@"

prior this line there should at least be feedback which system is used after all to address any issue.
in example something like

echo "emsdk will use $EMSDK_PYTHON"
echo "when py certif fail on macOS: open /Applications/Python \3.10/Install Certificates.command or according to your py version before running this script"

would have saved a lot of time addressing the fail of python certificates when downloading starts, apart from the fact that on my machine node is already installed in version v18.14.2 while the script forces to use node v14.18.2 - not sure if that is a typo in some script - could be coincidence.

@sbc100
Copy link
Collaborator

sbc100 commented Mar 23, 2023

Regarding the certificate issue, does running /Applications/Python \3.10/Install Certificates.command always fix the problem? If it does maybe we can detect the failure an recommend it. I'm not a macOS user so its hard for me to verify if that is the universal solution or not.

Regarding node, emsdk internally uses its own pinned version of node to avoid compatibility issues. Same for python. However we don't have our internal versions of python or node to your PATH so it should not effect you. At last not since #1189.

@designerfuzzi
Copy link
Author

designerfuzzi commented Mar 23, 2023

after research (stackoverflow, google search, apple support) seems to be the proper solution to fix this certificate issue with python on any version on macOS. As users can have multiple python versions installed in parallel, users usually figure out with which python3 which version and where is actually pointed to in the environment.

macOS users have for sure also manually installed Python Launcher.app or IDLE.app which comes with the certificate installing script, means it was meant to be called but i never needed it yet (a couple of years 7++), all my python environment workflows worked without it. Which is certainly also the reason why this issue comes up at all. After running the command emsdk works flawless installing.

A different approach would be to allow manually dropping the node-v14.18.2-darwin-x64.tar.gz into the emsdk folder and the script could take over from there avoiding the failing download by user interaction which on macOS is also expression of user intent and therefor a valid strategy to solve such issues. Writing this because that was my first attempt to fix my issue out of osx-user-habbit.

Sidenote: the Install Certificates.command skript might exist at all because double clicking such script is an expression of user intent as well and automated installing of those certificates would fail without user interaction - short: double clicking the script circumvents the guarding system

the proposal by calling ./emsdk activate latest would result in printing what version is actually used like..
emsdk will use /Users/username/userdevfolder/emsdk/python/3.9.2_64bit/bin/python3 which here says that all is well, it will indeed use emscriptens own python 3.9 release.

sbc100 added a commit that referenced this issue Mar 13, 2024
sbc100 added a commit that referenced this issue Mar 13, 2024
sbc100 added a commit that referenced this issue Mar 13, 2024
sbc100 added a commit that referenced this issue Mar 13, 2024
sbc100 added a commit that referenced this issue Mar 14, 2024
sbc100 added a commit that referenced this issue Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants